OptionalcanvasBackground color of canvas, default "#000000" (black)
OptionalcollisionsCollision configuration options
OptionalcollisionCollision broad phase method: BroadPhaseMethods.QuadTree or BroadPhaseMethods.SpartialGrid. Default values is BroadPhaseMethods.SpartialGrid
OptionalcollisionDefine a fixed rectangular area for collision detection
OptionalcollisionCollision detection method: CollisionMethods.SAT or CollisionMethods.ABB. Default value is CollisionMethods.SAT
HTML element where the game will be created
OptionaldebugDebug options
Show colliders
OptionalcollidersColor of the colliders, default "#00FF00" (green)
Show mouse position
OptionaltextColor of the text, default "#00FF00" (green)
OptionaltextPosition of debug text, default "bottom-left"
OptionaldependenciesExternal elements which can be accessed through dependency injection.
OptionalheadlessEnable Headless mode. The input and rendering functions are turned off. Ideal for game server development
Game height
OptionalphysicsFramerate for physics execution. The allowed values are 60, 120, 180, 240. The higher the framerate, the more accurate the physics will be, but it will consume more processor resources. Default value is 180.
Game width
Configuration options for initializing and customizing game behavior. Includes settings for canvas dimensions, debug visualization, physics simulation, collision detection, and dependency injection.
Required for creating a new Game instance.
Example