hey im trying to rotate a sprite (my player ship) towards a angle given by the controller
current code
if(Angle < WantedAngle-2)
Angle += MyShip.TurnSpeed;
else if(Angle > WantedAngle+2)
Angle -= MyShip.TurnSpeed;
this works as long as the angle is -90 to 90 (right is 0`) but if the angle is at 179 and wants to go to -170 instead of just going over it goes all the way around and i cant think of the code to fix it.
by the way my angles are in degrees from -180(left) to 180(left) with 0 on the right -90 on the top and 90 on the bottem
thanks in advance