Our game is nearly finished. In this chapter we’ll add the finishing touches. We’ll add a “game over” state that will end the game when our health reduces to zero. We’ll then add the ability to restart the game without reloading the page. Finally, we’ll add levels that will allow us to play the game continuously, with increasing difficulty and an increasing score multiplier.
Copy your code into a new folder for the final time. Save a copy of your exercise12.html file and rename it to exercise13.html.
Game Over
When the ship runs out of health, nothing happens. ...