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
run out.lives
Draw a new sprite called Game Over
using the text tool.
On the Stage, broadcast a game over
message just before the game ends.
Add this code to your
sprite so that it shows at the end of the game:Game Over
Because you’ve used a broadcast (game over) and wait
block on your Stage, the Stage will wait for the
sprite to be displayed before ending the game.Game Over
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?