This content has been marked as final. Show 3 replies
If it's correct or off by 180 degrees then it's probably the if-then you need to take out and work out if it's plus 270 or plus 90 which is correct.
> If it's correct or off by 180 degrees then it's probably the if-then you
> to take out and work out if it's plus 270 or plus 90 which is correct.
Thanks, seems to work perfectly. You know, I was trying to get it to be one
formula before, but it never worked. The 270/90 split was added to make it
work right in situations where it didn't before. It was all going perfectly
well, too, until I moved some of the sprites that were shooting the beams,
and then it failed again. And - hey, whoa... How are you using 2 values in
the atan() function? The documentation doesn't say anything about it taking
more than one parameter, I thought you had to give it a ratio of the two
sides in order to receive an angle. Is this some sort of weird undocumented
Originally posted by: Darrel Hoffman
Is this some sort of weird undocumented shortcut?
Yep. It is very useful because it avoids divide by zero errors and you don't have to convert values to floats.
put atan( 10, 0 )
put atan( 1/ 2 )
put atan( 1, 2 )