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

#1 2008-07-24 03:21:45

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

How can I make a game using abs block

How can I make a game using abs as well as the other standards
like the one below


<abs( 204


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

#2 2008-07-24 03:24:27

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

Re: How can I make a game using abs block

bart9032 wrote:

How can I make a game using abs as well as the other standards
like the one below


<abs( 204

I just know someone will answer so hurry up!


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

#3 2008-07-24 03:30:53

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

Re: How can I make a game using abs block

The ABS function returns the distance from zero for any number you give it.  So, if you give it -7 you get back 7 but if you give it a positive number, you just get the same number back.  I don't know if you could base a whole game on it, but let's say you wanted something to happen whenever two sprites were within 100 steps on the X axis.  You could compute the ABS of the difference of the two X positions and if that value was less than 100, have the script do something.


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

Offline

 

#4 2008-07-24 03:31:00

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: How can I make a game using abs block

abs means it turns negative (numbers with a - sign next to it) into a positive number (a number that doesn't have a - sign next to it)

Offline

 

#5 2008-07-24 11:05:08

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: How can I make a game using abs block

And Sqrt is obvious (square Root √), sin, cos, and tan are trig, which is very helpful  for keeping things in the right place in all directions.


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

Board footer