Pages: 1
Topic closed
There's a forum topic that talks about them here,
http://scratch.mit.edu/forums/viewtopic.php?id=1653
Hopefully that will give you some idea of how they are used.
Offline
Well lets do an example of a spinner (We're talking about numbers here.)
[blocks
Spin button:
<when[ spin clicked
<broadcast[ Spin
Spinner
<when I receive[ spin
<turn cw( <pick random( 1)to( 360
[/blocks]
Oh yeah if you ARE doing a spinner then make sre the spinner is the arrow of the spinner then do a background with the numbers/colours on it.
Offline
Now, a example for variables.
[blocks]For this example we'll use a "Score" variable. Comments are in blue.
Let's say everytime you click Sprite1 you get a point.
<when green flag clicked>
<set{ Score }to( 0 -- First it resets the score
<forever>
<wait( 0.5 )secs> -- Does this every 0.5 seconds
<go to x <pick random( -240 )to( 240 )y
<pick random( -180 )to( 180 -- Goes to a random position
<end>
<when[ Sprite1 ]clicked>
<change{ Score }by( 1 -- When clicked, gives a point
<go to x <pick random( -240 )to( 240 )y
<pick random( -180 )to( 180 -- Goes to a random position to make sure you don't cheat[/blocks]
That's my short lesson on Variables. You also might want to read my E-Book on it: link And also my E-Book on Scratch Math: link
Hope that helped!
Last edited by technoguyx (2009-04-05 14:51:15)
Offline
Topic closed
Pages: 1