diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..e6573eb --- /dev/null +++ b/main.cpp @@ -0,0 +1,28 @@ +#include "player.h" + + +int main() { + + int choice; + + //While loop to chose your player class + while (!std::cin >> choice || choice > 3 || choice < 1) { + std::cout << "Choose your character class. \n[1] Superman [2] Spider-Man [3] Batman; " << std::endl; + std::cin >> choice; + } + //Initalise instance "character" of player Class + player character(choice); + + std::cout << "\nWelcome " << character.printClass() << ". Let's begin your adventure. " << std::endl; + + //Print out player stats BS + std::cout << "Your starting stats:" << std::endl; + character.printStats();//END BS + + while() + + + std::cin.ignore(); + std::cin.get(); + return 0; +} \ No newline at end of file diff --git a/player.h b/player.h new file mode 100644 index 0000000..34a80fe --- /dev/null +++ b/player.h @@ -0,0 +1,84 @@ +#include +#include + + +class player +{ + std::string playerClass; + int level, attack, location; + + public: + int hp, experience; + + player(int choice) + { + location = ""; + if (choice ==1) + { + playerClass = "Superman"; + level = 1; + attack = 60; + hp = 100; + experience = 0; + } + if (choice == 2) + { + playerClass = "Spider-Man"; + level = 1; + attack = 20; + hp = 100; + experience = 0; + } + if (choice == 3) + { + playerClass = "BatMan"; + level = 1; + attack = 40; + hp = 100; + experience = 0; + } + + } + + std::string printClass() + { + return playerClass; + } + + /*BS*/ + //Method to output the player stats to the console + void printStats() + { + std::cout << "Player Class: " << playerClass << std::endl; + std::cout << "Player Level: " << level << std::endl; + std::cout << "Player Attack/Strength Level: " << attack << std::endl; + std::cout << "Player HP: " << hp << std::endl; + std::cout << "Player Exp: " << experience << std::endl; + } + //Method to return the player level + int playerLevel() + { + return level; + } + //Method to return the player attack/strength level + int playerAttack() + { + return attack; + } + //Method to return the players hp + int playerHp() + { + return hp; + } + //Method to return the players experience + int playerExp() + { + return experience; + } + //Method to return player location + std::string playerLocation() + { + return location; + } + /*END BS*/ +};