Game development

Stage 1 · Lesson 1 of 7

The game loop

How games are made

Every game runs the same loop many times a second. It reads input (keys, mouse, ), updates the world (moves things, checks hits, changes the score), then draws a new picture on screen, called a . At 60 frames per second, each pass through this game loop has about 16.7 milliseconds.

The engine runs the loop for you and calls your code at set points in it. That is why you write functions such as 's Update or 's _process rather than a main loop of your own. Knowing the loop explains three things.

Slow code shows up as . Movement must scale with the time each frame took. And physics often runs on its own fixed tick.

Common trapdoing something slow, like loading a file or searching every object, inside code that runs every frame.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with

  • VideoFree
    Game Maker's Toolkit

    Mark Brown (YouTube)

    Short, clear video essays on why games work, so you start thinking about design from your first clone

Practise

  • A large, beginner-friendly jam: the best first deadline for a tiny finished game

  • Browse the jam calendar, play small games, and later publish your own for free

Keep handy

  • A map of the whole field, to see where gameplay, maths, physics and graphics fit

  • The free Git book, for branching and recovering when a change breaks your game

Also worth your time

Mark this stage as not done?