ridder
Version:
A straightforward game engine for simple data-driven games in JavaScript
16 lines (15 loc) • 425 B
TypeScript
export type Timer = {
elapsed: number;
};
/**
* Create a new timer data structure.
*/
export declare function timer(): Timer;
/**
* Advance the timer by the time since the last frame, returns `true` if the timer has reached the duration this frame.
*/
export declare function tickTimer(t: Timer, duration: number): boolean;
/**
* Reset the timer back to zero.
*/
export declare function resetTimer(t: Timer): void;