Goal:
Awesome, that’s all the code that we’ll need for our game manager!
Let’s add one more small thing that can also help test our code, a Game Over screen.
After this code is done, test your code out. The game should have run for 30 seconds and show a Game Over screen once the time runs out.
Steps:
- Select the “Sprite1” sprite, all the following code will be for this sprite.
- From Events place a when green Flag clicked.
- From Looks place a hide block.
- From Events place a when I receive block.
- In that when I receive block, set the message to be “GameOver!”
- From Events place a go to layer block and change it to front.
- From Looks place a show block.