M
Midastouch
Guest
Hello everyone,
I am trying to build a little RPG and i wonder how can i increase my player's speed, linearly, exponentially...
I just want to know differents ways to do it in order to test them all and choose what is the best.
Actuallly this is how i do it :
I am trying to build a little RPG and i wonder how can i increase my player's speed, linearly, exponentially...
I just want to know differents ways to do it in order to test them all and choose what is the best.
Actuallly this is how i do it :
GML:
//-----------Intended movement-----------//
if movement_x = 0 && movement_y = 0 {
if input_left = 1 {movement_x = -1}
if input_right = 1 {movement_x = 1}
if input_up = 1 {movement_y = -1}
if input_down = 1 {movement_y = 1}
}
//-----------To increase the speed movement-----------//
if movement_x != 0 || movement_y != 0 {
time_value += 0.3}
else time_value = 0
//-----------APPLY MOVEMENT-----------//
value_on_x = sign(movement_x) * (abs(movement_x) + time_value);
value_on_y = sign(movement_y) * (abs(movement_y) + time_value);
x += value_on_x
y += value_on_y