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

#1 2012-01-27 20:01:24

MathMaster101
Scratcher
Registered: 2011-10-29
Posts: 100+

i'm kinda confused with operators

can someone please explain to me how to use an operator and give me some simple scripts to try out

when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
think [Scripts in your posts!] for (3) secs
sorry i also wanted to test something out, but please tell me an example of an operator how it works!

Edit: please, only include relevant scripts in your posts. --JSO

Last edited by JSO (2012-01-28 05:38:14)


https://sphotos.xx.fbcdn.net/hphotos-snc6/c39.0.403.403/p403x403/196165_191956434263692_1014187386_n.jpg

Offline

 

#2 2012-01-27 20:02:54

G0D_M0D3
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: i'm kinda confused with operators

Well, what operator block do you want to use?


I made a MC texture pack! Get it at planetminecraft!
http://i.imgur.com/0EG0u.png

Offline

 

#3 2012-01-27 20:06:33

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

Re: i'm kinda confused with operators

G0D_M0D3 wrote:

Well, what operator block do you want to use?

Yeah, we can't really help you until you be more specific  hmm


Why

Offline

 

#4 2012-01-27 20:13:30

gettysburg11
Scratcher
Registered: 2008-06-14
Posts: 1000+

Re: i'm kinda confused with operators

Depends on what you really want to do with them. Some examples of things they can be used for are math operations, conditional statements (and, or, not), string operations, and random number generating.  smile


http://i256.photobucket.com/albums/hh184/mnacmilan/LOGO_ACMILAN-Splash.gif

Offline

 

#5 2012-01-27 20:24:40

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: i'm kinda confused with operators

Example:

When gf clicked
forever
change y by (loudness)
if < (y position) > [0] >
change y by [-5]

Last edited by CheeseMunchy (2012-01-27 20:25:16)


6418,

Offline

 

#6 2012-01-27 21:00:22

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: i'm kinda confused with operators


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#7 2012-04-09 17:49:41

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: i'm kinda confused with operators

At first, I was really confused by operators. But, they are very useful. For example, for a target game where you click on targets, to make targets appear in random spots, you would do this:

when gf clicked
forever
 go to x ((pick random (-200) through (200)) y ((pick random (-200 through 200)
if <mouse down?>
 change [score] by (10)
 
They can be used to set variables, too. Say you do a speed game, where the faster you do something, the better. You could set the score to:
when i receive [done]
 set [SCORE 1] to ((timer))
 
And then after, say 3 rounds adding "timer" to SCORE 1, SCORE 2, and SCORE 3, you make a TOTAL SCORE variable, which adds all of them.
when i receive [end]
 show variable [TOTAL SCORE]
  set variable [TOTAL SCORE] to ((SCORE 1) + ((SCORE 2) + (SCORE 3)))
 
They have an infinite numbe more uses, including creating arcs using sine and cosine and tangent. I hope you found this useful!  smile


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#8 2012-04-10 09:47:57

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: i'm kinda confused with operators

([1] + [1])
they're used for maths


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

Board footer