Adding Scripts to the Stage
As well as sprites, you can add scripts to the Stage. Click the Stage in the Sprite List, and you’ll find it has its own Scripts Area. It’s a real pain to have to hunt through your sprites to find where you put a particular block so you can change it, so this is a good place to put scripts that affect the whole game and that aren’t associated with a particular sprite.
For this game, we should add a block to the Stage to set the score to 0 when the green flag is clicked. Otherwise, the score will rise ever higher with each successive game and will never be set back to zero when a new game starts.