Use requestAnimationFrame for rendering loops, not for your game logic · HackerTrans