Advertisement

Implementing a Main Loop in Dart

John McCutchan, Software Engineer, Google
  • Colt McAnlis
  • Petter Lubbers
  • Brandon Jones
  • Duncan Tebbs
  • Andrzej Manzur
  • Sean Bennett
  • Florian d’Erfurth
  • Bruno Garcia
  • Shun Lin
  • Ivan Popelyshev
  • Jason Gauci
  • Jon Howard
  • Ian Ballantyne
  • Jesse Freeman
  • Takuo Kihira
  • Tyler Smith
  • Don Olmstead
  • John McCutchan
  • Chad Austin
  • Andres Pagella
Chapter

Abstract

At the heart of your favorite games is the game loop. At the core of the game loop is control over the game clock. In each frame the game does some or all of the following: updates the game state, triggers timers, processes user inputs, renders graphics, and plays audio. Each of these operations must be synchronized using a virtual clock controlled by the game loop. This chapter explains how to implement a deterministic and efficient main loop for any type of game designed from the ground up to run in the browser.

Keywords

User Input Main Loop Analog Input Game State Input Event 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Colt McAnlis 2014

Authors and Affiliations

  • Colt McAnlis
    • 1
  • Petter Lubbers
    • 1
  • Brandon Jones
    • 1
  • Duncan Tebbs
    • 1
  • Andrzej Manzur
    • 1
  • Sean Bennett
    • 1
  • Florian d’Erfurth
    • 1
  • Bruno Garcia
    • 1
  • Shun Lin
    • 1
  • Ivan Popelyshev
    • 1
  • Jason Gauci
    • 1
  • Jon Howard
    • 1
  • Ian Ballantyne
    • 1
  • Jesse Freeman
    • 1
  • Takuo Kihira
    • 1
  • Tyler Smith
    • 1
  • Don Olmstead
    • 1
  • John McCutchan
    • 1
  • Chad Austin
    • 1
  • Andres Pagella
    • 1
  1. 1.CAUS

Personalised recommendations