How come only red variables show up on the (Something OF Something) block in the sensing block section, because i made seperate variables for seperate sprites, one sprite works perfectly, one sprite can only, on the (Something OF Something) block, only shows the names of the red variable blocks, why is this?
Offline
The red variables are local variables that can only be changed by the sprite they "belong" too. They are created by choosing "For this sprite only" when making a variable. The sensor block (Something of Something) allows other sprites to see the value of these variables but not to change them.
The yellow variables are global variables that can be changed (and seen) by all sprites directly so there is no need to have them in the sensor block.
Hope that helps clear things up!
Offline
Thanks so much!
Offline
Splatt,
It may seem like a bother to use local variables (and the "something of something", sensing block), but locals have some real advantages.
Below is a link to a thread that starts out with a beginner explanation of varibles (that you could skip, though it is well written and worth a review) and ends with a discussion of local/global variables:
http://scratch.mit.edu/forums/viewtopic.php?pid=17277#p17277
-MrEd
Offline