# Horizontal movement, acceleration, and max speed

**URL:** <https://forum.defold.com/t/horizontal-movement-acceleration-and-max-speed/66115>\
**Category:** Questions\
**Created:** [August 21, 2020, 12:24am UTC](https://forum.defold.com/t/horizontal-movement-acceleration-and-max-speed/66115 "2020-08-21T00:24:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [August 21, 2020, 6:20am UTC](https://forum.defold.com/t/horizontal-movement-acceleration-and-max-speed/66115/4 "2020-08-21T06:20:51Z")

</div>

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](https://forum.defold.com/t/floating-point-precision/11247).

---

_[View the full topic](https://forum.defold.com/t/horizontal-movement-acceleration-and-max-speed/66115)._
