How do I make my score reset after the game is over?
DanielVanDePutte
Member Posts: 11
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
-
tatiang Posts: 11,949
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
Would you like suggestions as to where in your code you may have made a mistake ?
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
@tatiang do I just add that after
display text game.score
@socks that would be great for your help !
I got it! thanks so much that's a big relief