SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

4.07 High score

You’re going to save the game’s high score, so that players can see how well they are doing.

Create a new variable called high score.

Stage sprite

Select the Stage. Click on ‘My blocks’ and create a new custom block called check high score.

Stage sprite
screenshot

Add code to your custom block so that the block checks if the current value of score in larger than the value of the high score variable, and then stores the value of score as the new value of high score.

Stage sprite

Add your new custom block to the Stage script before the end of the script.

Stage sprite

Play your game twice to check whether your score gets correctly saved as the high score.

×
×

Cart