This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-02-07 21:13:31

bingbongwong01
Scratcher
Registered: 2009-02-04
Posts: 8

Umm what are variables for?

what are variables for? How do u use them? Why?

Offline

 

#2 2009-02-07 21:19:13

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Umm what are variables for?

http://scratch.mit.edu/forums/viewtopic.php?id=1346


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2009-02-07 22:15:36

big-bang
Scratcher
Registered: 2008-02-21
Posts: 1000+

Re: Umm what are variables for?

bingbongwong01 wrote:

what are variables for? How do u use them? Why?

You can use them for scores (easy first-time application), but if you want serious gaming, you'll need them! Every scrolling game uses variables. You need old x and old y to stomp Goombas. Without variables, the best thing on Scratch would be Cube World!!! (AAAHHH!!!)


http://i47.tinypic.com/6edrbm.jpghttp://i45.tinypic.com/dw9hmw.jpghttp://i50.tinypic.com/f28tvn.jpghttp://i45.tinypic.com/ruwaop.jpg

Offline

 

#4 2009-02-08 06:00:46

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Umm what are variables for?

Here's another thread that might help answer your question

http://scratch.mit.edu/forums/viewtopic.php?id=1346


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#5 2009-02-08 08:54:21

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Umm what are variables for?

http://scratch.mit.edu/forums/viewtopic.php?id=13875
one of my tutorials is on variables

Offline

 

#6 2009-02-08 09:25:22

tro95
Scratcher
Registered: 2008-02-20
Posts: 78

Re: Umm what are variables for?

Variables are basically a place to store information.

If you had a "move 5 steps" block then it would just move 5 steps, but if you made it a "move variable1 steps" block and set variable1 as 5 then it would do the same thing, except later on in other bits of the code you could change that 5 to a 10 etc... and instead of having to use a new bit of code it just goes back to the "move variable1 steps" block, which will now move 10 steps.

Offline

 

#7 2009-02-10 21:15:03

bingbongwong01
Scratcher
Registered: 2009-02-04
Posts: 8

Re: Umm what are variables for?

o thanks guys and girls out there who replied ton my question:)

Offline

 

Board footer