Horizontal movement, acceleration, and max speed

If you are doing calculations in update() and don’t factor in delta time you will in a matter of frames (ie fractions of a second) end up at max speed.

I see that you’ve discarded the code from this post and I don’t really understand what you are doing with speed1 and speed2 in the snippet of code you shared. speed2 seems to be the be the horizontal max speed and speed1 is the current speed with movement factored in somehow.

BTW I created an example from the previous post where we discussed accelerating speed up to a max speed: https://defold.com/examples/basics/movement_speed/

2 Likes