SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

5.10 Game over

Next, you’re going to add a ‘game over’ message at the end of the game.

If you haven’t already, create a new variable called lives.

Your spaceship should start with three lives and lose a life whenever it touches a hippo or an orange. Your game should stop when the lives run out.

Draw a new sprite called Game Over using the text tool.

screenshot

On the Stage, broadcast a game over message just before the game ends.

gameover sprite

Add this code to your Game Over sprite so that it shows at the end of the game:

gameover sprite

Because you’ve used a broadcast (game over) and wait block on your Stage, the Stage will wait for the Game Over sprite to be displayed before ending the game.

Test your game. How many points can you score? If the game is too easy or too hard, can you think of ways to improve it?

×
×

Cart