variables are just numbers that scratch keeps track of. the value of the variable is stored. in the oval shaped block. you can fit that inside any spot where a number goes.
Last edited by jslomba (2011-07-03 09:31:01)
Offline
That's kinda right, but Variables don't store just numbers(Unless you're talking about what the computer reads). They can store any data you want! How do you like that? To use them, first make a new variable, second go to the set variable or change variable by blocks and type in what you want. I hope you have fun!
Offline
jslomba wrote:
variables are just numbers that scratch keeps track of. the value of the variable is stored. in the oval shaped block. you can fit that inside any spot where a number goes.
A variable can actually be any value, not just a number.
Variable on the Scratch Wiki.
Offline
A variable is a value that can change in the program. You can use a variable for a score, for example, because score changes.
Offline
Variables can be used for alot of diffrent things. For example: You are playing a game where a moving thin line is moving fast around the screen. Here is an example of what could happen when the variable is clicked:
<when green flag clicked>
<wait until> <mouse down?><< <and> >><touching[ Mouse Pointer
<set{ Game Win }to( 1
<when green flag clicked>
<set{ Game Win }to( 0
<wait until> <{ Game Win }> <( <=> )> 0
<stop all>
If you cant read that sorry and here is the script in text version:
When flag is clicked
Wait untill Touching mouse pointer and mouse down
Set game win to 1
When flag is clicked
Set game win to 0
Wait untill game win = 1
Stop All
So how it works? Sure you could have just brodcasted that the line was clicked on insted of using all this variable stuff but this is just an alt. way.
Understand?
Offline