Worms-Armageddon-HTML5-Clone icon indicating copy to clipboard operation
Worms-Armageddon-HTML5-Clone copied to clipboard

Game physics run too quickly on my 144hz monitor

Open Jarzka opened this issue 5 years ago • 0 comments

Hello and congrats on getting your final your project done!

Here is a quick feedback for you about the game.

I noticed that all the animations and physics run over two times faster on my 144Hz screen compared to a standard 60Hz screen. In general, the speed of game physics and animations should not be tied to the screen refresh rate, or in the case of web programming, the number of frames per second you get via requestAnimationFrame. This is a basic mistake in game programming.

This problem can be solved by using something called deltatime in all physics and animations. Deltatime is the time between the last frame and the current frame, so if you always multiple your game physics with deltatime, everything runs at the same speed on every device.

More information about delta time: http://www.informit.com/articles/article.aspx?p=2167437&seqNum=3 https://www.construct.net/en/tutorials/delta-time-and-framerate-independence-71

Jarzka avatar May 12 '19 07:05 Jarzka