need to know what to do about the variables (page). how and when can I use it in my scratch project
Offline
Variables can be used in a lot of different ways. They can be used to keep scores, keep track of lives, and more. Check out the Scratch Wiki's article on variables for more information :)
Last edited by RedRocker227 (2011-12-18 07:27:35)
Offline
A variable is a value that can be changed. You can refer to this value at any time and use it for many functions. If you have a taken an algebra class they work like that. They can be changed, set, and used in equations or functions.
Say you want a cat to move faster and faster than you would do this:
[blocks]<when green flag clicked>
<forever>
<move( <{ some }> )steps>
<change{ some }by(1[/blocks]
This would increase the scratch cat's speed every time he finished moving! Hope this gives you at least some understanding of the variables in scratch.
Last edited by soupoftomato (2011-12-18 21:29:09)
Offline
Thank you soupoftomato! I'll try that one!
Offline
they are also useful in games say if you want to have three lives you make a variable <{ lives }> then you could put
<when green flag clicked>
<if><touching[ sprite 2
<change{ lives }by( -1
Offline