At the moment, you can play the game forever, but it doesn’t count how many hippos you shoot or how many times your spaceship explodes.
Can you add lives
, a score
, or even a highscore
to your game?
It’s fun to keep track of a high score in a game.
Let’s say you have a variable called
, which gets set to zero at the beginning of each game.score
Add another variable called
.highscore
At the end of the game (or whenever you want to update the high score), you’ll need to check whether you have a new
.high score