Reset the Game

Program the reset button to restart the game.

Step 1

Go to the ResetButton drawer and drag the when ResetButton.Click block into the Viewer.

Step 2

To make sure the score resets to zero and the Sprite begins to move at the start of a new game, add the following code to the when ResetButton.Click block:

  • Set global Score to “0”
  • Call UpdateScore
  • Set Clock1TimerEnabled to “true”

The final code should look like this:

Step 3

Try it now! Try to win the game and then press the reset button to start again!