if (keyboard_check(vk_up))
{
x+=lengthdir_x(spd,player.direction-180);
y+=lengthdir_y(spd,player.direction-180);
}
if (keyboard_check(vk_right) or keyboard_check(vk_left))
{
var angle,X,Y,C,S;
angle = (keyboard_check(vk_left)-keyboard_check(vk_right))*rotspd;
image_angle+=angle;
angle*=pi/180;
C = cos(angle);
S =-sin(angle);
X = x - player.x;
Y = y - player.y;
x=player.x + X*C - Y*S;
y=player.y + X*S + Y*C;
}Ah got it working thanks to both of you! All glory to the math god. Here is an example of the code in use if anyone else wants to use it.



Find content
Male
