useInternalClock property

bool get useInternalClock

Whether gravity and lock delay are driven by the game's own timers.

Set to false to drive the game yourself with applyGravity and lockActivePiece (for example from a fixed-step game loop, an AI, or a replay).

Implementation

bool get useInternalClock => _useInternalClock;
set useInternalClock (bool value)

Implementation

set useInternalClock(bool value) {
  if (value == _useInternalClock) return;
  _useInternalClock = value;
  if (!value) {
    _gravityTimer?.cancel();
    _lockTimer?.cancel();
  } else if (_state.status == TetrisGameStatus.playing) {
    _startGravity();
    if (_lockPending) _startLockTimer();
  }
}