Horizontal movement, acceleration, and max speed

Although it appears you are using whole integers when doing the calculations, I wonder if there might still be floating point issues.
In general, I’d advice against compares using “==”, since these are floating point numbers. Ofc, if it is guarantueed to be whole numbers, it should be ok.
You can read a bit more about floating point precision here.

1 Like