Learn Create Your Own Split Screen

Next Page

We say the score has global scope, because any time any script mentions the score variable, they're all talking about the same score variable.

We say the mood has local scope, because any time we mention the mood variable we're talking about the one for that particular butterfly, and each one might be different.


Scratch includes a bunch of built-in variables with local scope. For example, the x-position, y-position, and pointing direction are all local -- every sprite has them, they're all called the same thing, but when you use them you're using the one that applies in that situation.

It feels natural.