Goal:
Let’s write code that will make sure our variables all get reset properly whenever we restart the game.
Steps:
- Select the Backdrop.
- From Events, place a when green flag clicked block.
- From Control, place 2 set Lives to blocks.
- Change one of them to “Lives:” and set the number to 3.
- Set the other one to “Points:” and set the number to be 0.
- From Events, create a message called “GameStart!” and broadcast it.