ok so please don't laugh at my code I have been writing C++ for about 3 weeks so I know its awful lol. I want to create class' of enemies that I can call on for battles with the player. I have successfully created and called a class but I seem to have to put the hit points for my enemy in the int main which surely means I am going to have to write out the hit points act for every type of enemy? any way I can create a class with integers in it so I just have to call the member of the class?
#include <cstdlib>
#include <iostream>
usingnamespace std;
class enship
{
public:
int earm;
int espeed;
int eweap;
int emav;
};
enship pf;
int main()
{
int arm = 30000; // input starting player stats arm= Armour, Speed = Speed, Weap = Weapon Power mav = Manouverability
int speed = 30000;
int weap = 30000;
int mav = 30000;
cout << "Welcome to your Starship Captain!.... \n We have to ship out immdiatley sir I am afraid the war marches on! \n";
cout << "The RIS StarTrooper is unfortunatlety not the most powerful in the fleet but she is a Destroyer class so shes a good solid ship! \n";
system("PAUSE");
cout << "welcome to the bridge captain! \n We will be patrolling the supply lines to the front lines first... \n";
cout << " There has been some pirate activity we belive is linked to the serpratists .. \n";
cout << " It should be a good prooving ground for our new ship! \n";
cout << " Oh and one more thing... The Admiral will only send upgrades our way \n if we can prove ourselves in battle\n";
system("PAUSE");
cout << "Enemy ship has appeared and engaged us!\n";
cout << emav << "\n";
cout<< eweap << "\n";
cout<< espeed << "\n";
cout << earm << "\n";
enship pf;
if ((earm + espeed + eweap + emav) < (arm + speed + weap + mav)) cout << "WE WON!\n";
elseif ((earm + espeed + eweap + emav) > (arm + speed + weap + mav)) cout << "We are going to have to retreat Captain!!\n";
system("PAUSE");
return EXIT_SUCCESS;
}