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

#1 2011-12-18 07:21:45

sherwinrabino
New Scratcher
Registered: 2011-12-10
Posts: 7

quiry

need to know what to do about the variables (page). how and when can I use it in my scratch project

Offline

 

#2 2011-12-18 07:27:09

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: quiry

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)


Why

Offline

 

#3 2011-12-18 21:28:54

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: quiry

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.  smile

Last edited by soupoftomato (2011-12-18 21:29:09)


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#4 2011-12-20 07:59:34

sherwinrabino
New Scratcher
Registered: 2011-12-10
Posts: 7

Re: quiry

Thank you soupoftomato! I'll try that one!

Offline

 

#5 2011-12-20 08:14:37

Jenncat
Scratcher
Registered: 2011-12-09
Posts: 11

Re: quiry

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


"So how do we tell whether she is made of wood?" "Build a bridge out of her!" "Ah, but can you not also make bridges out of stone?"

Offline

 

#6 2011-12-21 14:47:31

mcpNOVA
Scratcher
Registered: 2011-12-05
Posts: 100+

Re: quiry

Variables can be used for many things. I use them for sensors. But I guess its mostly used for stuff like "Level" or "Lives" or "score".


http://i43.tinypic.com/n5fqcz.jpg

Offline

 

Board footer