initialises a new instance of the Engine.
Lifecycle and update callbacks.
Configuration options for the engine.
Current background colour.
Registered engine callbacks.
Current frames per second (rolling average).
Current frame time in milliseconds.
Pixel height of the canvas.
Pixel width of the canvas.
Sets the CSS cursor style for the game canvas.
The CSS cursor value (e.g., 'pointer', 'crosshair').
Current mouse x position in world space.
Current mouse y position in world space.
StaticcameraThe global camera instance.
StaticcurrentStaticdebugToggle for visual debug mode (hitboxes and stats).
StaticdebugRecent collisions for debug visualization.
StaticobjectsGlobal set of game objects if no scene is active.
StaticpausedWhether the game loop is currently paused.
StaticrenderingStaticselectedStaticshowWhether to show collision normals/contact points in debug mode.
StaticshowWhether to show velocity/acceleration vectors in debug mode.
StaticsortedStatictotalReturns the total active time of the game (excluding pause time).
StaticzWhether the global object list needs to be re-sorted by z-index.
Starts a countdown timer that runs a function every second and an ending function.
The total duration of the countdown.
The function to run every second.
The function to run when the countdown is finished.
Schedules a function to run after a delay.
The function to run.
The delay in milliseconds.
A timer ID.
Completely stops the engine and cleans up all resources.
StaticcleanCleans up expired debug collisions.
Current timestamp.
StaticdestroyDestroy all objects in the active scene or global engine.
StaticdestroyRemoves a game object from the active scene or global engine loop.
The object to destroy.
StaticemitEmits a custom event on the global engine bus.
The event type.
Optionaldetail: unknownOptional data to pass with the event.
StaticoffStops listening for an event on the global engine bus.
The event type.
The function to remove.
StaticonListens for an event on the global engine bus.
The event type (e.g., 'paused', 'PLAYER_DIED').
The function to run when the event occurs.
StaticregisterRegisters a game object with the active scene or global engine loop.
The object to register.
StaticresetResets the engine state to its initial values. Useful for testing to prevent state bleed between test cases.
The core singleton class that manages the game loop, rendering, and scene state.