excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.82k stars 189 forks source link

More accurate deltaTime #3180

Closed chrispytoes closed 2 months ago

chrispytoes commented 2 months ago

I'm new to Excalibur, and I'm wondering why deltaTime is rounded to a whole number. It seems like my movement is actually smoother without using it at all because of how inaccurate it is. Logging it, it seems to keep jumping between 5 and 7, and always a whole number. It will never actually be correct since 60 fps has a deltaTime of 16.66.

eonarheim commented 2 months ago

@chrispytoes Thanks for the issue! I think we are using the highest precision timer available to us in js.