How do I make my score reset after the game is over?

DanielVanDePutteDanielVanDePutte Member Posts: 11
edited January 2015 in Working with GS (PC)

I added a high score to my game which works but for some reason or another after I add that, my score which has been working fine doesn't reset, adding more points onto the score I had before I died. Any help would be great because this is really frustrating!!

Best Answer

  • tatiangtatiang Posts: 11,949
    edited January 2015 Accepted Answer

    Generally, you'd want to reset the score within the rules for the button that resets the game. So if you have a Menu button or Retry button or something like that on your game over screen, add the Change Attribute behavior just before/above the Change Scene or Reset Scene behavior that you're using.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @DanielVanDePutte said:
    I added a high score to my game which works but for some reason or another after I add that, my score which has been working fine doesn't reset, adding more points onto the score I had before I died. Any help would be great because this is really frustrating!!

    Would you like suggestions as to where in your code you may have made a mistake ?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Attributes do not reset themselves. If you are using a game attribute such as game.score, you'll need to change it back to zero when your game resets by using Change Attribute game.score to 0.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • DanielVanDePutteDanielVanDePutte Member Posts: 11

    @tatiang do I just add that after
    display text game.score
    @socks that would be great for your help !

  • DanielVanDePutteDanielVanDePutte Member Posts: 11

    I got it! thanks so much that's a big relief :smile:

Sign In or Register to comment.