Good day.
I am writing a browser game on pure js, the method of drawing the entire game is executed in setInterval (method, 10)
after I added the animation (frame change, let's say), I added it to the same method that is called in setInterval.
As a result, the animation is also displayed with a delay of 10, although, the best option is to set its delay to 60: setInterval (anim, 60).
How to call two methods setInterval, so that the first deals with drawing the entire game with a delay of 10, and the second deals with drawing the animation with a delay of 60?
setIntervaltorequestAnimationFrame- and theFPSshould not be different for drawing the whole scene and animation - you shouldn’t do such crutches, specify the question - ampawd