I'm using the atan2 function to work out the angle to get to a waypoint (in 2d)and then angle the sprite in the correct direction.
Because atan2 doesn't work in 360 - just 180 I'd thought just add 180 to the result - but that doesn't work.
I'm sure it's something very simple, but I can't see the solution atm.
I've worked around the problem by rotating the sprite to 180 degree's and loading using loadanimimage as usual.
Here's my code...
angle# = ATan2(y_dist#,x_dist#)
If angle# < 0.0 angle# = angle# + 360.0
Because atan2 doesn't work in 360 - just 180 I'd thought just add 180 to the result - but that doesn't work.
I'm sure it's something very simple, but I can't see the solution atm.
I've worked around the problem by rotating the sprite to 180 degree's and loading using loadanimimage as usual.
Here's my code...
angle# = ATan2(y_dist#,x_dist#)
If angle# < 0.0 angle# = angle# + 360.0