Creates a new game instance.
Configuration options for the game.
Creates and starts a new timer that will be automatically updated by the game loop.
The duration in seconds before the timer triggers.
If true, the timer will restart after completing. Defaults to false.
The created Timer instance, allowing you to stop()
it manually if needed.
Creates and starts a new tween animation. The tween will be automatically updated by the game loop.
The type of the value being animated (e.g., Vec2, Color, number).
The object to animate.
The name of the property on the target to animate.
The final value of the property.
The duration of the animation in seconds.
The easing function to use. Defaults to Linear.
The created Tween instance, allowing you to chain calls like .onComplete().
// Tween a sprite's position over 2 seconds
game.createTween(mySprite, 'position', new Vec2(500, 300), 2, Easing.EaseOutQuad);
// Tween a shape's color to red and do something on completion
game.createTween(myShape, 'color', Color.Red, 1.5)
.onComplete(() => {
console.log('Color tween finished!');
});
Starts the game loop.
Stops the game loop.
Switches to a new scene, disposing of the current one.
The new scene to switch to.
Main game class managing the game loop, rendering, and input.