Goal:
The first thing we’re going to have our game manager do is set up some variables for us at the start of the game.
A variable is something that holds a piece of information that we can use many times in our code.
The Gameover will be set to 0 or 1, if it is 0 then the player can keep playing and if it is 1 then the game will end.
The Score variable will tell the player the score during the game.
The Time Remaining variable will be the timer counting down to zero.
Steps:
- Select the backdrop/stage (it is located next to the sprites under the main game window).
- From Events place a when green Flag clicked.
- From Events place a broadcast block and select new message.
- Name this new message “CreateBalloon!” This message will eventually be able to tell the game to create a new balloon at the start of the game.
- From Variables place three set to blocks.
- On the first set to block, select the variable “GameOver:” and set it to zero.
- On the second set to block, select the variable “Score:” and set it to zero.
- On the third set to block, select the variable “Time Remaining:” and set it to 30.