playMaker

Author Topic: Quick advice on comparing multiple ints or something alternative  (Read 1587 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Hi,
I have a level selection scene,  that has a best score under each thumbnail of the level.  If I have like many levels each with is own global score variable,  the only way I can think of checking if a score had been beaten,  is doing a compare int action for EVERY level,  at the start of the level selection scene. 
Is there a way I can check which level was last played,  and then check if the score was improved on that particular level?

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Quick advice on comparing multiple ints or something alternative
« Reply #1 on: January 30, 2015, 08:19:32 PM »
- Have a 'currentscore' integer
- Have a high score integer variable for each level.  'Score1', 'Score2'...'Score5'.
- Set an integer called 'lastlevelplayed'.  So if level 5 just played, set it to 5 after the round.
- Use a int switch to compare swich  score to compare to
- Then compare the 'currentscore' with the score of that level ('score1').
- If higher set the new high score.

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Quick advice on comparing multiple ints or something alternative
« Reply #2 on: January 31, 2015, 01:58:13 AM »
Excellent,  thanks a lot.