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

#1 2010-01-29 02:41:09

revolutioniser
Scratcher
Registered: 2009-12-13
Posts: 36

how do you use these blocks

<(  <<>  )><(  <>>  )> how do you use these two blocks and what do you use them for?


click on the kid or be sad as him
http://i2.metalslugsprites.net/static/sprites/m/street/pedestrians.14.gif

Offline

 

#2 2010-01-29 03:01:43

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: how do you use these blocks

[blocks] <( X <>> Y )> [/blocks]means that  X is grater than Y.  Where the symbols lines meet that means that,the number where the lines meet is the smaller number. Now these block are booleans so they return a result of either true or false so if you type 3 > 1 it will return true if you type 3 < 1 it will return false.
X > Y means X grater than Y
X < Y means X less than Y

Usally you will put variable blocks (Those rounded edge blocks) in there so that the out come isn't the same all the time.

Last edited by what-the (2010-01-29 03:03:56)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#3 2010-01-29 03:29:52

revolutioniser
Scratcher
Registered: 2009-12-13
Posts: 36

Re: how do you use these blocks

what-the wrote:

[blocks] <( X <>> Y )> [/blocks]means that  X is grater than Y.  Where the symbols lines meet that means that,the number where the lines meet is the smaller number. Now these block are booleans so they return a result of either true or false so if you type 3 > 1 it will return true if you type 3 < 1 it will return false.
X > Y means X grater than Y
X < Y means X less than Y

Usally you will put variable blocks (Those rounded edge blocks) in there so that the out come isn't the same all the time.

thanks. i was hopinng to use them for something else but now i understand why it wont work.


click on the kid or be sad as him
http://i2.metalslugsprites.net/static/sprites/m/street/pedestrians.14.gif

Offline

 

#4 2010-01-30 15:30:16

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: how do you use these blocks

One way they are often used is to contain a sprite's movement on the screen.

For example, IF (x position) > 240
                     Go to x (0) y (0)

So if the sprite went off the right side of the screen it would immediately go back to the center of the screen.

Or, if it goes beyond the right side of the screen you could call a new background [and send the sprite back to x (-240)] to continue journeying across the new background.

Or, using y values, keep a sprite from going too high or too low on the screen.

(One reason the ">" can be very useful is that if you said "IF (x position) = 240"...it might never happen. If the sprite is moving 5 steps at a time it might skip right on by the "240" position and so never trigger the next command.)

Offline

 

Board footer