Ugh, I havn't posted a question in forever...

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
deryni21
Chaos Rift Regular
Chaos Rift Regular
Posts: 124
Joined: Wed Dec 24, 2008 9:55 pm

Re: Ugh, I havn't posted a question in forever...

Post by deryni21 »

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 class

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];
well 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...
Can anyone help me with this problem???
Now by "Text Based" you mean a console rpg right?
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Ugh, I havn't posted a question in forever...

Post by eatcomics »

yerp
Image
Post Reply