So I want to make a small JavaScript game.
And in order to do that I need to animate a few things.
I went researching and found about setInterval
and requestAnimationFrame
.
I can use either of those 2 for making my game work, however I understood that requestAnimationFrame
is the better alternative there.
The problem I see with this is that while the function has its benefits , you are unable to set a framerate , or an update rate for it easily.
I found another thread that explained a way of making this work however it seemed somewhat complicated.
Is there an easier way of animating with a set framerate ?