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. -
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… -
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: -
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… -
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. -
AnimatedSpriteOptionsType Alias Construction-time configuration for an AnimatedSprite. Every field is optional; an omitted field takes the documented default. -
SpriteOptionsType Alias Construction-time configuration for a Sprite. Every field is optional; an omitted field takes the documented default. -
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… -
TextOptionsType Alias Construction-time configuration for a Text. Every field is optional; an omitted field takes the documented default. -
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… -
TilingSpriteOptionsType Alias Construction-time configuration for a TilingSprite. width and height are required — they define the region the texture tiles across — and everything else takes the documented…
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.…
Geometry
-
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… -
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… -
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. -
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…
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.