Discuss Scratch

MagzVA
Scratcher
21 posts

Variables.....what are they?

Hi there! Everyone keeps suggesting to use variables for my game that I am trying to make (I am not getting anywhere though) so I just thought that I would ask if someone could tell me what they are? And one more quick question (you don't have to answer both) how do you get a signature after you post something? All mine is right now are smiley faces. Thanks to everyone who will help!

I can NOT live without books
-Thomas Jefferson to John Adams
I can NOT live without books or anything that involves programming games
-MagzVA to all the Scratchers on Scratch


I am awesome. I made awesomeness. Awesomeness lives in me!
Kayah
Scratcher
42 posts

Variables.....what are they?

MagzVA wrote:

Hi there! Everyone keeps suggesting to use variables for my game that I am trying to make (I am not getting anywhere though) so I just thought that I would ask if someone could tell me what they are? And one more quick question (you don't have to answer both) how do you get a signature after you post something? All mine is right now are smiley faces. Thanks to everyone who will help!
1. Variables are basically a piece of code that can change. To change them in scratch you can use these blocks:
set [X v] to [0]

change [X v] by (1)
you can make them words or numbers. In case you want to know how to make them just click “new variable” in the editor. hope this helps.
PS. to make a signature go to the discussion home and click “New signature”

You won't be unknown anymore

I love Birds!
; oh! no idea how that got there…
; that's better
;;;;;;;;; noooooooo!


GadgetAndyMan
Scratcher
100+ posts

Variables.....what are they?

More information on variables can be found in the Wiki article.

Latest project updated: X-Y Coordinates Challenge - 14 Jan 2014: Various improvements.

My Likes Studios [ Animation | Art | Education | Games | Simulation | Stories ]
Please take a look and follow any studios that interest you with the projects I am adding.
Photoguy77
Scratcher
100+ posts

Variables.....what are they?

Variables are basically numbers that we change with code. For example in all games the score displayed is a variable. Then when you need the score to go up you change it with code. For example, if a character in your game is touching the other character you would use code to change the score variable. Below are some useful scripts for variables.
forever
if <touching [character2 v]?>
change [score v] by (1)
end
forever
if <touching [enemy v]?>
change [score v] by (-1)
I hope this helps you understand the uses of variables.

-Photoguy77

“Without enjoying, one will never truly learn” ~Flome

“Finding happiness starts in you” ~ProdigyZeta7

MagzVA
Scratcher
21 posts

Variables.....what are they?

Thanks! This really helped! (my favorite smile)

I can NOT live without books
-Thomas Jefferson to John Adams
I can NOT live without books or anything that involves programming games
-MagzVA to all the Scratchers on Scratch


I am awesome. I made awesomeness. Awesomeness lives in me!
TheSupremeOverLord
Scratcher
99 posts

Variables.....what are they?

Please read this. A variable basicly just stores the value of something, for example a score.
Just like in math. Cloud variables store the value on a server.

Hope this helped!

-Supreme

THE GAME (you just lost)
Chrome 23.0.1271.101 on iMac running Mac OSX Mountain Lion 10.8.2 with Flash Player 11.4.402.287
Buy it, use it, break it, fix it, Trash it, change it, mail – upgrade it, Charge it, point it, zoom it, press it, Snap it, work it, quick – erase it, Write it, cut it, paste it, save it, Load it, check it, quick – rewrite it, Plug it, play it, burn it, rip it, Drag and drop it, zip – unzip it, Lock it, fill it, call it, find it, View it, code it, jam – unlock it, Surf it, scroll it, pause it, click it, Cross it, crack it, switch – update it, Name it, rate it, tune it, print it, Scan it, send it, fax – rename it, Touch it, bring it, pay it, watch it.
Technologic.
; Preserve the semi-colons! ;
GadgetAndyMan
Scratcher
100+ posts

Variables.....what are they?

TheSupremeOverLord wrote:

Please read this. A variable basicly just stores the value of something, for example a score.
Just like in math. Cloud variables store the value on a server.

Hope this helped!

-Supreme
Already linked to that

Latest project updated: X-Y Coordinates Challenge - 14 Jan 2014: Various improvements.

My Likes Studios [ Animation | Art | Education | Games | Simulation | Stories ]
Please take a look and follow any studios that interest you with the projects I am adding.

Powered by DjangoBB