How do I make my score return to 0 [FB]
ttotman87
Member Posts: 1
So I am making a flappy bird clone and I am having problems making my score return to zero after I get a game over. The issue occurs with me tapping my redo button or even when I restart from my home page scene after a game over and then having my score stay at the number it was prior to getting the game over. If anyone knows how to solve this I would really appreciate the input. Thanks.
Comments
When you use a Reset Game behavior, it resets all game attributes back to their default values. Just a note that this is not generally a useful behavior because often you'll want to keep some attributes at whatever value they had been during gameplay. What most people do is to add change attribute behaviors in their play or restart button actor and change attribute game.score to zero.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Simply, when your flappy bird or whatever the heck you're using hits a pipe, create a new rule with the following parameters:
when actor receives event, overlaps or collides, with actor of type, PIPE (or whatever your obstacles are called)
change attribute game.score (or whatever your score attribute is called) to 0.
Hope this helps.
Thanks!