API Reference
Generated from the engine's source. Every type, method, and parameter below is documented in-tree; cross-references link straight to the symbol they mention.
Core
-
AbstractComponentClass Shared base class for the tier-specific abstract component classes — AbstractGameComponent, AbstractWorldComponent, and AbstractWorldObjectComponent. -
AbstractComponentHostClass Abstract base class for component hosts able to extend their own base class. Implements the ComponentHost interface with behaviour aligned to the documentation of those methods. -
AbstractGameComponentClass Abstract base class for components attached to a Game. -
EngineErrorClass Engine-thrown error carrying a machine-readable ErrorCode and an optional context bag of values relevant to the failure (the offending host, key, component type, etc.). Every… -
ErrorCodeEnum Stable string codes attached to every EngineError thrown by the engine. Codes are part of the public contract — user code is expected to branch on them when handling engine… -
GameClass Root container for an arcade2d application. A Game owns the renderer (a PIXI Application under the hood), the per-frame ticker, and everything else that is conceptually *outside*… -
ComponentInterface Defines a component that can be added to a host object. -
ComponentHostInterface Defines an object that can host components. -
AddComponentOptionsType Alias Options accepted by ComponentHost.addComponent and its multi-add siblings. Pulled into its own type so future knobs can be added without widening the call signature. -
ComponentFactoryType Alias Factory function shape consumed by addComponentFromFactory and addComponentsFromFactories. The host is passed in so the factory can construct a component with the correct… -
ComponentFactoryMapType Alias Plain map of component key → component factory consumed by addComponentsFromFactories. Each factory is invoked with the host during registration. -
ComponentHostConstructorType Alias Newable type used by getComponentByType / hasComponentByType / etc. Accepts any constructor that produces a T — the engine never invokes it, it's used purely as an instanceof… -
ComponentMapType Alias Plain map of component key → component used by the multi-add APIs and returned from addComponents so callers can grab refs to what they registered without a follow-up getComponent… -
GameCanvasOptionsType Alias Sizing strategy for the application's canvas. -
GameOptionsType Alias Options accepted by Game.bootstrap. -
ASSET_LIBRARY_COMPONENT_KEYVariable Reserved component key the engine uses to register the AssetLibrary on every Game. Exposed as a constant so callers that need to introspect or replace the asset registry (e.g.… -
KEYBOARD_COMPONENT_KEYVariable Reserved component key the engine uses to register the Keyboard input sampler on every Game. Exposed as a constant so callers that need to introspect or replace the keyboard… -
MOUSE_COMPONENT_KEYVariable Reserved component key the engine uses to register the Mouse input sampler on every Game. Exposed as a constant so callers that need to introspect or replace the mouse component… -
throwEngineErrorFunction
World
-
AbstractWorldComponentClass Abstract base class for components attached to a World. -
AbstractWorldObjectComponentClass Abstract base class for components attached to a WorldObject. -
CameraClass The world's viewport — a "look-at point" in world space, plus an orientation and a zoom factor — that downstream presentation components (notably Scene) use to decide what part of… -
PrefabClass A template for spawning WorldObjects with a pre-defined component graph. Prefabs are the engine's primary unit of object composition: rather than instantiating a world object and… -
PrefabRegistryClass A name-keyed lookup table of Prefabs. The registry exists for two reasons: -
WorldClass The root container for an arcade2d simulation. A World owns the set of live WorldObjects, drives the per-frame update loop that animates them, and itself hosts world-scoped… -
WorldObjectClass A single addressable thing inside a World. A WorldObject is a spatial node that hosts Components — controllers, visuals, colliders, audio sources, anything else — and provides… -
WorldTimerClass A small accumulator-style timer for tracking elapsed real-world time across frames. Game code typically needs one of two patterns: -
WorldUpdateClass The per-tick context produced by World.update and threaded into every component's onPreUpdate, onUpdate, and onPostUpdate hook for the duration of that tick. -
WorldComponentInterface A component attached to the World itself. Use this rather than the lower-level Component interface whenever you're writing a world-scoped system — input samplers, physics… -
WorldDependencyResolverInterface Dependency resolver passed to WorldComponent.resolveDependencies. Exposes lookups against other components on the same World host; does **not** expose a requireFromWorld-style… -
WorldObjectComponentInterface A component attached to a WorldObject. Use this rather than the lower-level Component interface for any per-object behaviour — controllers, graphics, colliders, audio sources,… -
WorldObjectDependencyResolverInterface Dependency resolver passed to WorldObjectComponent.resolveDependencies. Exposes both sibling lookups (other components on the same WorldObject) and cross-tier lookups against the… -
DependencyComponentConstructorType Alias A constructor reference suitable for the resolver's type-based lookup methods. Re-exposed alias of ComponentHostConstructor so user code importing the resolver doesn't need to dig… -
DependencyLookupRecordType Alias One record of a dependency lookup performed during a single component's resolveDependencies call. The resolver records every require* / optional* invocation so engine internals… -
FindByTagOptionsType Alias Optional flags accepted by World.findByTag and World.findOneByTag. -
PrefabComponentContextType Alias Context handed to each PrefabComponentFactory when a prefab is materialised into a concrete object. Carries both the world the object is being added to and a reference to the… -
PrefabComponentFactoryType Alias A function that produces a single component for a freshly-built prefab instance. The factory is called exactly once per Prefab.buildObject call, so each spawn gets its own… -
PrefabComponentMapType Alias Map of component keys to factory functions, describing the starting component graph of any object built from a Prefab. -
PrefabOptionsType Alias Options accepted by the Prefab constructor. -
SetParentOptionsType Alias Options controlling how WorldObject.setParent re-homes an object within the transform hierarchy. -
WorldErrorContextType Alias Context handed to the WorldOptions.onError handler whenever a user-supplied component callback throws during the engine's update or teardown. -
WorldErrorPhaseType Alias Lifecycle phase in which a WorldErrorContext was produced. -
WorldObjectMetadataType Alias Metadata describing a WorldObject's relationship with the world it belongs to. Constructed by the engine during spawn (either through a Prefab or World.createEmpty) and held… -
WorldOptionsType Alias Options accepted by the World constructor. -
CAMERA_COMPONENT_KEYVariable Reserved component key used by the engine to register the auto-attached Camera on every World. Surfaces as a constant so user code that — for whatever reason — needs to introspect… -
ORIGINVariable The world-space origin (0, 0), frozen so it can serve as the shared default spawn position for WorldObjects without any caller being able to mutate the shared instance.… -
SCENE_COMPONENT_KEYVariable Reserved component key used by Game.createWorld to register the world's Scene graphics root. Exposed so callers that need to introspect or replace the scene (e.g. swapping in a…
Graphics
-
AbstractGraphicsClass Base class for WorldObject-attached components whose visual is a Pixi display object. AbstractGraphics owns the boilerplate that every such component needs: -
AbstractTexturedGraphicsClass Base class for the graphics components that wrap a *textured* Pixi display object — Sprite, AnimatedSprite, TilingSprite, and Text. It sits between AbstractGraphics (which owns… -
AnimatedSpriteClass Renders a sequence of Texture frames attached to a WorldObject, advancing through them on a timer to produce a flip-book animation — the standard way to put a walk cycle, an idle… -
CircleGraphicsClass Renders a filled Circle centered on the host's position. The circle geometry is positionless — its placement on screen comes from the host WorldObject's transform, synced once per… -
LayerClass One render layer in a LayerSet — a lightweight, world-agnostic token that names a band in the draw order and remembers where it sits in that order. -
LayerSetClass An ordered, named set of render layers — the developer-defined draw order a game stamps onto its graphics. -
PolygonGraphicsClass Renders a filled Polygon attached to a WorldObject. The polygon's vertices are interpreted in the host's local space: vertex (0, 0) is the host's position, and the polygon rotates… -
SceneClass The world-scoped graphics root: every WorldObject-attached graphics component parents its display object to the Scene, and the Scene in turn lives under the Pixi Application's… -
SpriteClass Renders a Texture attached to a WorldObject — the standard way to put an image (or one frame of a spritesheet) on screen. -
TextClass Renders a string attached to a WorldObject — the standard way to put dynamic text on screen. -
TextureClass A drawable view onto an ImageAsset — *what* to draw, as distinct from the Sprite component that decides *where* to draw it. -
TilingSpriteClass Renders a Texture repeated across a rectangular region attached to a WorldObject — the building block for tiled floors, walls, and scrolling backgrounds. -
AnimatedSpriteOptionsInterface Construction-time configuration for an AnimatedSprite. Extends the shared TexturedGraphicsOptions (anchor, tint, alpha, visible) with the playback controls. Every field is… -
GraphicsOptionsInterface The visual options shared by *every* graphics component — shape and textured alike. Specific option types (ShapeGraphicsOptions, TexturedGraphicsOptions) extend this with the… -
TextOptionsInterface Construction-time configuration for a Text. Extends the shared TexturedGraphicsOptions (anchor, tint, alpha, visible) with the typographic settings. Note fill is the glyph colour,… -
TexturedGraphicsOptionsInterface The visual options shared by every *textured* graphics component — Sprite, AnimatedSprite, TilingSprite, and Text. Extends the base GraphicsOptions (alpha, visible) with the two… -
TilingSpriteOptionsInterface Construction-time configuration for a TilingSprite. Extends the shared TexturedGraphicsOptions (anchor, tint, alpha, visible) with the region and tiling controls. width and height… -
ShapeGraphicsOptionsType Alias Construction-time configuration for the shape graphics components (CircleGraphics, PolygonGraphics). The fill colour is a positional constructor argument; this bag carries the… -
SpriteOptionsType Alias Construction-time configuration for a Sprite. A sprite adds nothing beyond the shared textured-graphics surface, so this is exactly TexturedGraphicsOptions — anchor, tint, alpha,… -
TextAlignType Alias Horizontal alignment for the lines inside a Text. Mirrors the canvas-text aligns the renderer accepts, narrowed to the three values that make sense for left-to-right Latin… -
TextureFrameType Alias A rectangular sub-region of an image, in source-pixel coordinates, used to sample one frame out of a larger image (a spritesheet cell, a tileset tile, an animation frame). -
TextureGridOptionsType Alias Describes how to slice a regular grid of equally-sized frames out of one image — the common layout for tilesets and animation strips. Consumed by Texture.grid, which walks the… -
defineLayersFunction
Assets
-
AssetClass A loaded, ready-to-use game resource managed by an AssetLibrary. -
AssetBundleClass A static, declarative description of a group of assets — a namespace plus a map of friendly key to load path — defined once at module scope and reused wherever those assets are… -
AssetLibraryClass Game-tier registry that loads, caches, and hands out Asset resources — textures today, audio and other kinds later. -
AssetTypeEnum The kind of resource an Asset wraps. The type determines which concrete Asset subclass an AssetLibrary produces when it loads a path, and which typed payload accessor that… -
BoundAssetBundleClass An AssetBundle bound to a specific AssetLibrary — the callable form you actually load and read assets through. -
FontAssetClass An Asset wrapping a loaded web font registered on the document's FontFaceSet. -
ImageAssetClass An Asset wrapping a loaded raster image as a GPU texture. -
AssetBundleEntriesType Alias The shape of an AssetBundle's entry map: a record of friendly key to load path. The keys become the compile-time-checked argument to BoundAssetBundle.get; the values are the paths… -
AssetBundleKeyType Alias The union of valid key arguments for a bundle with entries E — its string keys. Used to type BoundAssetBundle.get and friends so a mistyped or undeclared key fails at compile time. -
AssetBundleLoadOptionsType Alias Options for BoundAssetBundle.load. -
AssetConstructorType Alias A constructor for a concrete Asset subclass (e.g. ImageAsset), used as a runtime type witness by AssetLibrary.getAs. Mirrors the ComponentHostConstructor pattern used for typed… -
AssetLoadManyOptionsType Alias Configuration for AssetLibrary.loadMany. Identical to AssetLoadOptions but without key — each path in the batch is stored under its own path, so a single shared key would collide.… -
AssetLoadOptionsType Alias Per-load configuration for AssetLibrary.load. -
DEFAULT_ASSET_NAMESPACEVariable The namespace an Asset is stored under when a load or lookup does not specify one. Most small games never need more than this single namespace; reach for explicit namespaces (see… -
defineAssetBundleFunction -
inferAssetTypeFunction
Audio
-
AudioAssetClass An Asset wrapping a decoded audio clip as a Web Audio AudioBuffer. -
AudioCategoryEnum Routing categories an AudioInstance (and the components that own one) connects through inside the AudioEngine. -
AudioEngineClass Game-tier root of the audio graph: owns the Web Audio AudioContext, the master and per-category gain buses, and the seam used by AssetLibrary to decode AudioAssets and by the… -
AudioInstanceClass One playing voice in the audio graph — a single connection of an AudioBuffer through per-instance gain and panner nodes into a category bus on the AudioEngine. -
AudioSourceClass Plays short, one-shot sound effects from a WorldObject. -
MusicClass Plays a single, long-lived audio track at the world tier — the background music for a level, menu, or boss fight. -
AudioEngineOptionsType Alias Bootstrap configuration for the AudioEngine, threaded through GameOptions.audio. -
AudioInstanceOptionsType Alias Per-instance options passed to AudioEngine.createInstance (and indirectly to AudioSource.play / Music). -
AudioSourceOptionsType Alias Construction-time configuration for AudioSource. Every field is optional with a sensible default. -
AudioSourcePlayOptionsType Alias Per-call configuration for AudioSource.play. Every field is optional and overrides the source's defaults for this one voice only — the source's stored volume/pan are untouched. -
MusicOptionsType Alias Construction-time configuration for the Music world component. -
AUDIO_ENGINE_COMPONENT_KEYVariable Reserved component key the engine uses to register the AudioEngine on every Game. Exposed as a constant so callers that need to introspect or replace the audio backend (e.g.… -
clampVolumeFunction
Physics
-
PhysicsDebugRendererClass A world-scoped debugging overlay that draws the outline of every collider in the PhysicsWorld on top of the scene. It exists to answer the question that comes up constantly when… -
PhysicsWorldClass The world-scoped owner of the physics simulation: a thin, opinionated arcade2d façade over a [Rapier](https://rapier.rs) World. Add one to a World and every RigidBody component in… -
RigidBodyClass Gives a WorldObject a physical presence: a Rapier rigid body and one or more colliders that fall under gravity, collide with the rest of the world's bodies, and (for dynamic… -
CapsuleInterface A capsule collider shape — a rectangle capped with a semicircle on each end, oriented vertically. Capsules are the standard collider for characters because their rounded ends… -
ColliderOptionsInterface Describes one collider attached to a RigidBody: its shape plus the material and role knobs that govern how it responds to contact. A body can carry several, letting you build a… -
CollisionEventInterface A single collision delivered to a RigidBody's RigidBodyOptions.onCollisionStart or RigidBodyOptions.onCollisionEnd listener: a description of *who* touched (or stopped touching)… -
PhysicsDebugRendererOptionsInterface Construction options for a PhysicsDebugRenderer. Every field is optional; the defaults trace each body's colliders as a one-pixel outline tinted with Rapier's own debug colours. -
PhysicsWorldOptionsInterface Construction options for a PhysicsWorld. Every field is optional; the defaults (see PhysicsWorld) produce a downward-gravity world stepping at 60 Hz, suitable for a typical… -
RigidBodyOptionsInterface Construction options for a RigidBody. A body needs at least one collider — supply exactly one via RigidBodyOptions.collider, or several via RigidBodyOptions.colliders. Providing… -
ColliderShapeType Alias A shape usable as a physics collider. The engine's existing geometry primitives double as collider shapes, plus Capsule for the one shape geometry doesn't model. -
CollisionListenerType Alias A listener for RigidBody collision start/end events. See CollisionEvent for the payload and RigidBodyOptions.onCollisionStart for the enabling semantics. -
RigidBodyTypeType Alias The simulation behaviour of a RigidBody. -
DEBUG_OVERLAY_Z_INDEXVariable The zIndex assigned to the PhysicsDebugRenderer's overlay so it sorts above every regular graphics component. Bodies are typically drawn as *filled* shapes, so an outline rendered… -
DEFAULT_DEBUG_LINE_WIDTHVariable Default stroke width, in world pixels, for PhysicsDebugRenderer outlines when PhysicsDebugRendererOptions.lineWidth is omitted. One pixel reads as a crisp hairline at the default… -
DEFAULT_FIXED_TIME_STEPVariable Default fixed simulation timestep, in seconds — one sixtieth of a second, i.e. a 60 Hz physics tick. The PhysicsWorld accumulates real frame time and advances the simulation in… -
DEFAULT_GRAVITYVariable Default gravity, in **pixels per second squared**, applied when PhysicsWorldOptions.gravity is omitted. Points down the screen (positive y), matching the engine's screen-space… -
DEFAULT_MAX_SUB_STEPSVariable Default cap on how many fixed steps PhysicsWorld will run in a single frame. Bounds the catch-up work after a long stall (a backgrounded tab, a GC pause) so the simulation never… -
DEFAULT_PIXELS_PER_METERVariable Default value for PhysicsWorldOptions.pixelsPerMeter. Wired straight into Rapier's lengthUnit, telling the solver that "one human-scale meter" is 50 pixels so its internal error… -
initPhysicsFunction -
isPhysicsReadyFunction -
PHYSICS_WORLD_COMPONENT_KEYVariable Component key the engine convention reserves for the world's PhysicsWorld. Unlike Scene or the input samplers, PhysicsWorld is **not** auto-attached — physics is opt-in — but when…
Geometry
-
CellClass A single addressable position in a Grid, carrying both gameplay data and the metadata the grid's algorithms read. -
CircleClass Defines a circle as a pure shape: it is described entirely by its radius and has no position of its own. Where a circle "is" in the world is the responsibility of whatever owns it… -
GridClass A fixed-size rectangular lattice of Cells addressed by integer x (column) / y (row) coordinates — the backbone for tile maps, board games, tactics movement, fog-of-war, and… -
MatrixClass A 2D affine transform — the engine's representation of a fully-resolved **world transform**. Where a WorldObject stores its transform as a human-friendly decomposed triple… -
PointClass Defines a point in 2D space. Provides functionality for common operations between points and the parent space such as calculating distances and angles, and performing vector… -
PolygonClass Defines a polygon as a pure shape: an ordered ring of vertices in the polygon's own local coordinate space. The polygon has no world position of its own — its vertices are… -
RectangleClass Defines an axis-aligned rectangle as a pure shape, described by its width and height. Like every shape it is positionless; its local space is anchored at the top-left corner 0,0… -
NeighborOptionsInterface Controls how neighbouring cells are enumerated by Cell.neighbors and, by extension, the moves A* considers in Grid.findPath. -
PathfindingOptionsInterface Options for Grid.findPath. Extends NeighborOptions so the same diagonal/wrap connectivity rules govern which moves the search may make. -
PointPrimitiveInterface Plain structural shape used for any { x, y } value the engine accepts — including the Point class itself and bare object literals like { x: 100, y: 200 }. Methods that consume… -
PolygonBoundsInterface The local-space axis-aligned extents of a Polygon, as the minimum and maximum corner. Both corners are frozen. -
ShapeInterface The common contract every pure shape in the geometry package implements — Circle, Rectangle, and Polygon. It exists so code can treat shapes uniformly (measure them, test… -
WithinOptionsInterface Options for Grid.within, the radius/area query. -
DecomposedTransformType Alias The translation/rotation/scale factors recovered from a Matrix by Matrix.decompose. This is the lossy inverse of Matrix.compose: it round-trips cleanly for any matrix that was… -
GridHeuristicType Alias A pathfinding heuristic — an estimate of the remaining cost from a to b. To keep A*'s result optimal the estimate must be *admissible* (never greater than the true cost) and… -
GridInitType Alias Factory invoked once per cell when a Grid is constructed, used to seed each cell's Cell.data payload. Return null to leave a cell empty. -
GridMetricType Alias The three distance metrics a Grid understands, each appropriate to a different movement model: -
ImmutablePointPrimitiveType Alias Frozen variant of PointPrimitive — both the readonly modifier and a runtime Object.freeze are applied by the producers that return this type. Use when handing a primitive snapshot… -
chebyshevFunction -
DEFAULT_CELL_COSTVariable The default movement cost of stepping into a Cell — used by Grid.findPath unless overridden per cell (Cell.cost) or per call (PathfindingOptions.cost). A uniform cost of 1 makes… -
DEFAULT_CELL_PASSABLEVariable Whether a Cell is walkable by default. Cells start passable; mark the walls impassable rather than the floors passable. -
findPathFunction -
manhattanFunction -
octileFunction -
shapesIntersectFunction
Input
-
KeyboardClass Game-scoped input sampler that tracks the set of physical keys currently held on the keyboard. -
MouseClass Game-scoped input sampler that tracks the canvas-local mouse position and the state of the three standard buttons (left, middle, right). -
KeyboardStateInterface Per-tick snapshot of keyboard state — the set of currently-held physical keys and a convenience predicate for membership tests. Returned by Keyboard.getState and by… -
MouseButtonsInterface Held-state booleans for the three standard mouse buttons, exposed as a named bag on MouseSnapshot (and MouseState) so they're a) addressable as a group (if (state.buttons.left))… -
MouseSnapshotInterface Per-tick snapshot of mouse state at the **game tier** — canvas-local pointer position and held button state, with no concept of a camera or world transform. Returned by… -
MouseStateInterface Per-tick snapshot of mouse state at the **world tier** — the MouseSnapshot plus a position field giving the cursor's location in world space, with the active world's camera…
Utilities
-
IDGeneratorClass Mints short, monotonically increasing string identifiers. Used by the engine to assign ids to objects that need a stable handle for the lifetime of a world (e.g. World entities… -
RandomClass A seedable pseudo-random number generator and a grab-bag of common game-development helpers built on top of it. -
IDGeneratorOptionsType Alias Options accepted by the IDGenerator constructor. Also the shape returned by IDGenerator.getState, so a generator can be persisted and later rehydrated by passing the captured… -
RandomOptionsType Alias Options accepted by the Random constructor.