• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Differents ways to increase the player's speed

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 :

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