Index Ai Academy
Glossary · Phase 7 · Software engineering

Game loop

Also written: game loops

The cycle at the heart of a game: update the state, draw a frame, then wait for the next tick and do it again.

Try it now

Keys and the timer only change state. The picture is redrawn from that state every tick.

Learn it properly

Project: Pack Train, an arcade game · A grid game on the turtle canvas: game state as classes, a timer loop, key handlers and a saved best score. About 45 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write