Keeping score

You can use a variable to keep track of score in a game.

All you need to do is decide when you want the score to increase and by how much. Create a new variable called score, and add code that increases the score when appropriate. For example, when the player taps an object, increase the score variable by one:

If you want to display the score to the player, you can do this with a text object that constantly sets its text to the score.

You can also decide when to make the score decrease, if you’d like to do that too. To do this, use the yellow Increase block, but with a negative amount instead of a positive.

Still need help? Contact Us Contact Us