ridder
Version:
A straightforward game engine for simple data-driven games in JavaScript
32 lines (31 loc) • 1.05 kB
TypeScript
/**
* Set the initial time.
*/
export declare function setupState(): void;
/**
* Update the current state of the game loop.
*/
export declare function updateState(): boolean;
/**
* The scalar value of the time between the last frame and the current frame.
* This value is calculated based on the desired 60 frames per second.
*
* Using this value will make sure that your game runs at the same speed on all frame rates.
*
* NOTE - Use this for physics or movement. For animations (tweens) or timers, use {@link getDeltaTime} instead.
*/
export declare function getDelta(): number;
/**
* The time in milliseconds between the last frame and the current frame.
*
* NOTE - Use this for animations (tweens) or timers. For physics or movement, use {@link getDelta} instead.
*/
export declare function getDeltaTime(): number;
/**
* Get the current frames per second.
*/
export declare function getFramePerSecond(): number;
/**
* Get the elapsed time in milliseconds since the game started.
*/
export declare function getElapsedTime(): number;