zampa
Member
So i am working with delta time for movement and i had a question
this is my movement code
and this is how i set delta
but i found out that delta varies a lot from frame to frame
ex:
0.94
1.00
1.04
0.98
1.02
rounding delta is not an option
so i thought to do it this way
because the value is way more stable
i mean it works i just wanted to know if this is a good way to do it
or could this create some problems am i not seeing right now
thanks
GML:
hmovement = ((hspd * move_spd * speed_mod) + knockback_x) * delta;
vmovement = ((vspd * move_spd * speed_mod) + knockback_y) * delta;
Code:
delta = (delta_time/1000000) * 60;
but i found out that delta varies a lot from frame to frame
ex:
0.94
1.00
1.04
0.98
1.02
rounding delta is not an option
so i thought to do it this way
Code:
delta = 60/fps;
i mean it works i just wanted to know if this is a good way to do it
or could this create some problems am i not seeing right now
thanks