Step 7: Keeping Track of a High Score

Goal:


After all of this code, our game is now fully functional!

However, we still need to do one last thing. Our game manager needs to keep track of whether or not the player got a new high score.

Let’s do this next! Once this is done feel free to play the game and see how high of a score you can get!

Be sure you are still coding on the backdrop/stage as all this code will also go here

Steps:

  1. From Events place a when I receive block
  2. In that when I receive block, set the message to be “GameOver!”
  3. From Control place an if then block
  4. From Operators place a “>” block inside the if then block
  5. From Variables place a round “Score:” block on the left side of the “>” block
  6. From Variables place a “High Score:” block on the right side of the “>” block
  7. From Variables place a set to block inside the if then block
  8. Inside the set to block on the left side, set the variable to be “High Score:”
  9. From Variables place a round “Score:” block on the right side of the set to block

Code: