🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·🇬🇧 Limited Time — UK Only·🎓 Free Learning for 1 Month·🤖 Free AI Training Included·📚 4,000+ Lessons · 35,000+ Quizzes·🏆 GCSE Mocks · Olympiad Papers·⚡ Selected Students Only · Limited Places·🎁 Free Value Worth £2,000·
🎮 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
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.

Quick Quiz

1 / 2

What does requestAnimationFrame() do?