Let’s make things more interesting by keeping score.
To keep the player’s score, you need a place to put it. Create a new variable
called score
.
When a new game is started (by clicking the flag), you should set the player’s score to 0. Add this code to the top of the balloon’s when flag clicked
code:
Whenever a balloon is popped, you need to add 1 to the score:
Run your program again and click the balloon. Does your score change?