How do I High Score?

1 favourites
  • 6 posts
From the Asset Store
Create the right kind of drama with Film Scoring Tools sound library!
  • Hello, I need some help. In my game I have a high score system. But everytime I restart the layout (my player died), the current score is added to the high score. This is the event for scoring : (for the reset when my player died I just put Restart Layout and set TotalDistance to 0)

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are reading and writing to Local Storage on every tick, this is very wrong.

    You should write to local storage once at the end of the level/game, if CurrentScore>HighScore.

    And read from Local Storage also just once - On Start of Layout, and only if HighScore=0. When HighScore already contains a value, you don't need to retrieve it from local storage.

  • You are reading and writing to Local Storage on every tick, this is very wrong.

    You should write to local storage once at the end of the level/game, if CurrentScore>HighScore.

    And read from Local Storage also just once - On Start of Layout, and only if HighScore=0. When HighScore already contains a value, you don't need to retrieve it from local storage.

    I'm sorry for the late reply and thank you for trying to help me but I still don't understand. I try to change it a bit like in the picture bellow. But in the end of the game (player alive = 0) if the current score (TotalDistance) is greater than High Score, the high score number that showed in the end of game keep increasing for 3-5 seconds (there is no event for this increased number and for how many seconds. The higher the score is, the wait time for this number to settle is increased). But in the end it will set the new high score. For the score (TotalDistance) I still using scoring system at my first post (but I delete system > Add obj_player.Playform.Speed * dt to RECORD). I use this video for the high score tutorial wwwyoutubecom/watch?v=kfqNyZRaodg

  • the screenshot for my 2nd post

  • Events 22 and 25 on your screenshot are still running on every tick when conditions are met. They are reading/writing to local storage 60 times per second, which should not happen!

    Here is the correct way to do this:

    dropbox.com/s/fame0mgsqcy2kmk/SaveScoreToLocalStorage.capx

  • Events 22 and 25 on your screenshot are still running on every tick when conditions are met. They are reading/writing to local storage 60 times per second, which should not happen!

    Here is the correct way to do this:

    https://www.dropbox.com/s/fame0mgsqcy2kmk/SaveScoreToLocalStorage.capx?dl=0

    Thank you for your great help. Now finally I can sleep in peace.

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