Answers for "leveling system c++"

C++
1

leveling system c++

void LevelUp()
{
  static const int required_experience[] =
  {
    0, 45, 95, 145, 210, 285, 380, 495, 610, 745, 99999999
  };
  //so whenever myexp reaches on of these integers, mylvl will go up by 1

  while(myexp >= required_experience[mylvl])
    ++mylvl;
}
Posted by: Guest on May-02-2020

Browse Popular Code Answers by Language