var inputrot[3];
var inputs[3];
function getWASD()
{
var moving;
var temprot;
inputs[0] = (key_w - key_s) + joy_force.y;
inputs[1] = (key_a - key_d) - joy_force.x;
inputs[2] = 0;
moving = vec_length(inputs);
vec_to_angle(inputs,inputs);
temprot = inputs[0] - inputrot[0];
temprot = cycle(temprot,-180,180);
if(abs(temprot) > 2) inputrot[0] += sign(cycle(minv(temprot,360 - temprot),-180,180)) * time_frame * 20;
vec_set(inputs,nullvector);
if(moving) vec_for_angle(inputs,inputrot);
}