Let's
imagine you've written a Scratch game that involves
butterflies fluttering around the screen and you have to
catch them in a net.
You're obviously going to make one butterfly sprite, then clone it.
We're going to make it that each butterfly can be in various different "
moods", and the mood controls how the
butterfly behaves.
There'll also be a score.
The script for the butterfly will check the mood and make it move in different ways. Whenever the butterfly touches the net, it will adjust the score depending on the mood (up if it was in a good mood, down if it was in a bad mood).
- The mood needs to be a "for this sprite only" variable, since each butterfly has its own mood
- The score needs to be a "for all sprites" variable, because even though each butterfly adjusts the score, there's only one score in the whole game.