How do I show the high scores for each level?

  • C3/Mobile

    I nearly made an entire game without help! Nearly.

    I'm making a little game for my nephews. Nothing complicated.

    There are 8 levels. They have to get through each level at least once before moving on to the next level, but the goal of the game is just to live as long as possible. The longer the player lives the higher the score. (Really the goal is to get a higher score than the other brother on every level - they're 6 & 7.)

    I have the level menu. They play a game, die and then can play the next level. Once they have played/opened/unlocked all 8 levels, the goal is to get a higher level then the other brother.

    Here's my problem, I got it setup so the high score is shown on the level menu leader board, but I don't know how to make a high score show for each level. Each time any level is played it always records the highest score on the level menu leader board under the first level - of course because I don't know how to tell it to put the score for level 2 next to the level 2 icon on the level menu leader board.

    I know I can make more variables for each level, but a lot of games have stars and scores and I'm thinking there has to be away to identify level 2, 3, 4 and so on in the same way I do to unlock the next level, but I'm stuck on stupid.

    Thoughts?

    drive.google.com/file/d/1jPzgtDqWeeXwJJ_mxs5zCWVZC8OSih3r/view

  • You can store highscore of each level to Local Storage as a String and load each of them when start the game.

    The highscore will be separated with a separator.

    e.g.:1000,2000,1500,0,0,0,...

  • It's not easy to update the string when some score changes.

    I recommend using an array instead.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Maverick1912,

    Thank you. I hadn't thought of that.

    dop2000,

    I had a feeling you were going to say that.

    I'm just going to have to get over my fear of arrays.

    Time I stop fighting it and learn to use them properly.

    Thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)