void Fire::update(float dt){ if (m_velocity.x == 0){ return; } if (isFlippedX()){ setPosition(getPosition() + m_velocity); } else{ setPosition(getPosition() - m_velocity); } updateBodyBox(); checkEnemy(); ++m_nTimer; if (m_nTimer > 30){ runAction(m_endAction); } }
void FightMenu(Character* &theCharacter) { if (!bProgress) { bLevels[0] = true; int i; for (i = 1; i != 20; ++i) bLevels[i] = false; bProgress = true; } bool bQuit = false; int enemy = 0; while (!bQuit) { cout << "\n==============================\n"; cout << "Battlegrounds\n"; cout << "==============================\n"; if(bLevels[0]) cout << "1.Thief\n"; if(bLevels[1]) cout << "2.Orc\n"; if(bLevels[2]) cout << "3.Troll\n"; if(bLevels[3]) cout << "4.Wizard\n"; if(bLevels[4]) cout << "5.Dark Wizard\n"; if(bLevels[5]) cout << "6.Dark Knight\n"; if(bLevels[6]) cout << "7.General\n"; if(bLevels[7]) cout << "8.Legendard Swordsman\n"; if(bLevels[8]) cout << "9.Giant\n"; if(bLevels[9]) cout << "10.Demon\n"; if(bLevels[10]) cout << "11.Jaime Lannister\n"; if(bLevels[11]) cout << "12.White Walker\n"; if(bLevels[12]) cout << "13.Dark Angel\n"; if(bLevels[13]) cout << "14.Lucifer\n"; if(bLevels[14]) cout << "15.Tywin Lannister\n"; if(bLevels[15]) cout << "16.Genghis Khan\n"; if(bLevels[16]) cout << "17.Vladmir Putin\n"; if(bLevels[17]) cout << "18.Anti-Christ\n"; if(bLevels[18]) cout << "19.Joseph Stalin\n"; if(bLevels[19]) cout << "20.Adolf Hitler\n"; cout << "21. Exit Feeding Grounds\n\n"; cout << "Choose your opponent: "; cin >> enemy; system("cls"); if(enemy == 21) bQuit = true; else if(enemy > 21) cout << "No such enemy\n"; else checkEnemy(theCharacter, enemy); } }