Goal:
There’s one last thing we’re going to need our game manager to keep track of, and that’s the high score.
When the score is greater than the high score, we want to replace the variable high score with the variable score.
Be sure you are still coding on the backdrop/stage as all this code will also go here.
Steps:
- From Events place a when I receive block and set the message to be “GameOver!”.
- From Control place an if then block.
- From Operators place a “>” block inside the if then block.
- From Variables place a round “Score:” block on the left side of the “>” block.
- From Variables place a round “High Score:” block on the right side of the “>” block.
- From Variables place a set to block inside the if then block.
- Inside the set to block on the left side, set the variable to be “High Score:”.
- From Variables place a round “Score:” block on the right side of the set to block.