How do I make my score return to 0 [FB]

ttotman87ttotman87 Member Posts: 1
edited March 2014 in Working with GS (Mac)

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

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

    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

  • Conifer_AppsConifer_Apps Member Posts: 100

    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.

  • ttotman87ttotman87 Member Posts: 1

    Thanks!

Sign In or Register to comment.