I have a on_key function which fires if the button 'w'(forward),'a'(rotate left), 'd'(rotate right) is pressed, if 'w' is pressed I want to calculate a new x,y. I have the x,y coordinates and a degree, depends on which degree the object currently has i want to calculate new coordinates which goes for example one pixel in that direction.
_ship->x = _ship->speed*cos(_ship->rotation+90)+_ship->x;
_ship->y = _ship->speed*sin(_ship->rotation+90)+_ship->y;
This is my solution which does not work. note: _ship->rotation+90, +90 because the picture is perpendicular
Example: I pressed w and rotated it.