Nope. Most of them were defined with
int mynumber;
then initialized in the member function.
And yea, it says it''s in the begining of a while loop thats like
while (pHealth >0 || mHealth > 0 || runcounter == 1)
I dunno. I tried making it one statement per while loop and embedding the while loop, but I get the same thing.
I''m not at home right now and I forgot the disk my code is on, so I''ll post it tomorrow probably.
compiler error
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
find your elementat mutedfaith.com.<º>
Read above post.
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
find your elementat mutedfaith.com.<º>
try using an infinite loop and use a switch statement to break out of the loop. it''ll isolate the problem statement and make it easier to read. you can always change it back when you get the code working
int Fight()
{
Dude.mHealth = 1;
Dude.mPower = 1;
Dude.mExperience = 1;
Dude.mMoney = 1;
int answer;
int tempLevel = 1;
int tempcounter = 0;
ShowStats();
cout << "\nThis room has a monster, do you wish to fight? (1/2)";
cin >> answer;
if (answer == 1)
{
while (pLevel > 0)
{
pLevel --;
Dude.mHealth = Dude.mHealth + 10;
Dude.mPower = Dude.mPower + 5;
Dude.mExperience = Dude.mExperience + 5;
Dude.mMoney = Dude.mMoney + 5;
tempcounter ++;
}
while (Dude.mHealth > 0 || pHealth > 0)
{
while (runcounter = 1)
{
FightStuff();
}
}
if (Dude.mHealth < 0 || pHealth > 0)
{
pExperience = Dude.mExperience + pExperience;
cout << "Good job! You have won!";
if (pExperience > (tempcounter * 3))
{
pLevel = tempcounter;
pHealth = pHealth + (2 * pHealth);
pPower = pPower + (2 * pPower);
pMagic = pMagic + (2 * pMagic);
pLevel++;
ShowStats();
}
}
} // end first if
return 0;
} // end Fight
There is the entire function Player::Fight. I do have some of those switch statements in my program, just not here.
EDIT: The code is intented, but when I post it it's not.
Edited by - hibiki_konzaki on March 9, 2002 7:04:45 PM
{
Dude.mHealth = 1;
Dude.mPower = 1;
Dude.mExperience = 1;
Dude.mMoney = 1;
int answer;
int tempLevel = 1;
int tempcounter = 0;
ShowStats();
cout << "\nThis room has a monster, do you wish to fight? (1/2)";
cin >> answer;
if (answer == 1)
{
while (pLevel > 0)
{
pLevel --;
Dude.mHealth = Dude.mHealth + 10;
Dude.mPower = Dude.mPower + 5;
Dude.mExperience = Dude.mExperience + 5;
Dude.mMoney = Dude.mMoney + 5;
tempcounter ++;
}
while (Dude.mHealth > 0 || pHealth > 0)
{
while (runcounter = 1)
{
FightStuff();
}
}
if (Dude.mHealth < 0 || pHealth > 0)
{
pExperience = Dude.mExperience + pExperience;
cout << "Good job! You have won!";
if (pExperience > (tempcounter * 3))
{
pLevel = tempcounter;
pHealth = pHealth + (2 * pHealth);
pPower = pPower + (2 * pPower);
pMagic = pMagic + (2 * pMagic);
pLevel++;
ShowStats();
}
}
} // end first if
return 0;
} // end Fight
There is the entire function Player::Fight. I do have some of those switch statements in my program, just not here.
EDIT: The code is intented, but when I post it it's not.
Edited by - hibiki_konzaki on March 9, 2002 7:04:45 PM
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
find your elementat mutedfaith.com.<º>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement