Hallo.
I have a function that use atan2 for aiming another object...
direction=atan2(endy-starty,endx-startx)
and i have a array that contain a rotated image from 0 (the image face north) and at degree of 10 ends up facing north again(frame 10 = first frame) so the frame facing south is five(firsta frame facing north rotated 180 degrees clockwise).
I can i know what frame to display at the various atan2 variables?
example:
if atan2 is from 0 to 10 display frame 1
Or there's a better method for sorting the frame to display?
I have a function that use atan2 for aiming another object...
direction=atan2(endy-starty,endx-startx)
and i have a array that contain a rotated image from 0 (the image face north) and at degree of 10 ends up facing north again(frame 10 = first frame) so the frame facing south is five(firsta frame facing north rotated 180 degrees clockwise).
I can i know what frame to display at the various atan2 variables?
example:
if atan2 is from 0 to 10 display frame 1
Or there's a better method for sorting the frame to display?