• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ Differents ways to increase the player's speed

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 :

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
 
Top