Game Loop with requestAnimationFrame
Games redraw the screen 60 times a second. requestAnimationFrame asks the browser for the next frame โ clear, move, draw, repeat.
What you'll learn
Build a real animation loop.
New command
requestAnimationFrame(loop)
๐ป Code Editorhtml
๐ฌ
Press Run Code to see your creation!