Re: Ugh, I havn't posted a question in forever...
Posted: Fri Feb 06, 2009 10:27 pm
Now by "Text Based" you mean a console rpg right?eatcomics wrote:So I'm doing a text based rpg in c++, and I'm working on the battle system, well the problem is I have a classwell the problem is the array of enemies I have set up doesn't work, it will only let me use the first variable e[0] and then if I try to use any of the others it crashes, it compiles but the game crashes... and that makes me sad...Code: Select all
class Enemy { string nam; //name of said enemy int chp; //current hp int cmp; //current mp int att; //attack int def; //defense int res; //resistance int spe; //speed int pre; //precision int crt; //critical public: string ENam(string); int EChp(int,int,int,int); int ECmp(int,int,int,int); int EAtt(int,int,int,int); int EDef(int,int,int,int); int ERes(int,int,int,int); int ESpe(int,int,int,int); int EPre(int,int,int,int); int ECrt(int,int,int,int); } e[2];
Can anyone help me with this problem???