Initialize Timer object.
Function called every tick (core loop update).
Function called on timer completion.
Time in seconds for the timer to run.
Time in seconds to wait before starting timer.
Used by core loop to remove the object when dead.
Used by core loop to skip rendering. False, unless changed by user.
Called by core loop each tick.
Updates internal state and calls onTick or onDone functions as needed.
Delta time since last update.
Countdown timer that calls a function on each tick, and optionally on completion.
Example
// Moving a sprite into position on a game scene over 2 seconds, // with a half-second delay before starting. const timer = new Timer((r: number) => (sprite.pos.y = elasticOut(r) * game.height - game.height / 1.6), () => {}, 2, .5 )