Step 9: Making the Game Over Screen Appear

Goal:


Let’s code the game over screen that will appear when the player loses.

At the start of the game, this game over screen will not appear on the game screen.

Once the player receives the GameOver broadcast message when they lose the game, then the game over screen will appear.

Steps:

  1. Now click on the “GameOver” sprite.
  2. From Events, grab a when green flag clicked block.
  3. From Looks, place a hide block.
  4. From Control, place a when I receive block and change it to GameOver!
  5. From Looks, place a show block.

Code: