How can I make a game using abs as well as the other standards
like the one below
<abs( 204
Offline
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!
Offline
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.
Offline
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
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.
Offline