🎮 Game Design
The Game Loop — The Heartbeat of Every Game
Every game runs a game loop: clear the screen → update positions → draw everything → repeat. In JavaScript we use requestAnimationFrame() to call our loop ~60 times per second. This makes animations smooth and responsive.
3 min 10 XP Lesson 1 of 9

Every game runs a game loop: clear the screen → update positions → draw everything → repeat. In JavaScript we use requestAnimationFrame() to call our loop ~60 times per second. This makes animations smooth and responsive.
Quick Quiz
What does requestAnimationFrame() do?