not_quite_sure
Member
Hello,
Making a top down space shooter and not using the physics engine in game maker studio 2.
I have movement code that is mostly nice and smooth for turning speeds / acceleration / deceleration figured out but when I release a direction key (key_up or key_down) and start rotating the sprite left and right the direction follows the sprite image angle and not the natural "inertia" or "momentum" of the object as I want for something that's just cut power the engines and drifts.
I'm using lengthdir_x and lengthdir_y as below. old_direction is me trying to store the image angle as a variable when the key_up or key_down key is released but unsure how to do this.. happy with another method if one can be suggested.. I'm sure its something simple just leaning GML currently..
if !key_up || !key_down & spd >= 0
{
x = x + lengthdir_x(spd, old_direction);
y = y + lengthdir_y(spd, old_direction);
}
Making a top down space shooter and not using the physics engine in game maker studio 2.
I have movement code that is mostly nice and smooth for turning speeds / acceleration / deceleration figured out but when I release a direction key (key_up or key_down) and start rotating the sprite left and right the direction follows the sprite image angle and not the natural "inertia" or "momentum" of the object as I want for something that's just cut power the engines and drifts.
I'm using lengthdir_x and lengthdir_y as below. old_direction is me trying to store the image angle as a variable when the key_up or key_down key is released but unsure how to do this.. happy with another method if one can be suggested.. I'm sure its something simple just leaning GML currently..
if !key_up || !key_down & spd >= 0
{
x = x + lengthdir_x(spd, old_direction);
y = y + lengthdir_y(spd, old_direction);
}