running property

bool running

Whether or not the game loop is running and the UI is refreshing itself every frame.

Initially off.

If you want to manually refresh the UI yourself when you know it needs to be updated -- maybe your game is explicitly turn-based -- you can leave this off.

Implementation

bool get running => _running;
void running=(bool value)

Implementation

set running(bool value) {
  if (value == _running) return;

  _running = value;
  if (_running) {
    html.window.requestAnimationFrame(_tick);
  }
}