20.01.2013, 20:20
not "move 90", but "turn 45" degrees.
to calculate a players rotation for letting him face to a certain spot, use the atan2() function, supplying the offsets (difference) between the 2 desired locations.
it may occur that you need to add 180° to the final result or exchange the subtraction parameters on both x- and y position for calculatuing the angle...
to calculate a players rotation for letting him face to a certain spot, use the atan2() function, supplying the offsets (difference) between the 2 desired locations.
it may occur that you need to add 180° to the final result or exchange the subtraction parameters on both x- and y position for calculatuing the angle...