You are on page 1of 1

Keeping Track of Player’s Lives

Games commonly keep track of a player’s lives. When an enemy collides with the player, the
player loses a life. The game is over when lives goes down to 0.

These exercises add to your game from yesterday. Follow the steps below carefully and
complete all exercises. Be sure to ask a questions whenever necessary.

1. Go to the variables category and make a new variable called “lives”. Make sure “For all
sprites” is checked and then click Ok.

2. Now go to the enemy character and find the code that says “wait until touching sprite 1”
and change it to this

Now your character will lose a life when it hits this enemy.

You might also like