Skip to content

API reference ​

The framework is published as quantum-forge (core) and quantum-forge-engine (engine) on npm, each with subpath exports. Each feature has its own entry point.

This reference covers quantum-forge 3.0 and quantum-forge-engine 2.0. Engine 2.0 requires core ^3.0.0, so install or upgrade the two together. Moving from 2.x? See Migrating to 3.0.

Package exports ​

Core (quantum-forge):

ExportImport pathPrimary exports
Quantumquantum-forge/quantumquantum, Quantum, measure, probabilities, densityMatrix, phaseRotate, QuantumRecorder, ensureLoaded, useQuantumForgeBuild
Loggingquantum-forge/loggingLogger, LoggerInterface
Vite pluginquantum-forge/vite-pluginquantumForgeVitePlugin

Engine (quantum-forge-engine):

ExportImport pathPrimary exports
Enginequantum-forge-engine/engineEngine
Eventsquantum-forge-engine/eventsEventBus
Operationsquantum-forge-engine/operationsOperationRegistry, OperationExecutor
Renderingquantum-forge-engine/renderingPixiRenderer, CanvasRenderer, GameLoop, Camera
Inputquantum-forge-engine/inputInputManager, LocalMultiplayerManager, GamepadButtons, GamepadAxes
Collisionquantum-forge-engine/collisionSpatialGrid, rectOverlaps, circleOverlaps
Audioquantum-forge-engine/audioAudioManager
Particlesquantum-forge-engine/particlesParticleSystem
Entitiesquantum-forge-engine/entitiesEntityManager (disposes quantum handles on removal), createEntity
Animationquantum-forge-engine/animationTween, MultiTween, AnimationManager, Easing
State machinequantum-forge-engine/state-machineStateMachine
Timerquantum-forge-engine/timerTimerManager
Savequantum-forge-engine/saveSaveManager
Scenesquantum-forge-engine/scenesSceneManager

quantum-forge-engine depends on quantum-forge, so installing the engine gives you both.

Dependencies ​

eventemitter3 is a real dependency of the engine package and npm installs it for you.

pixi.js and howler are optional peer dependencies. Neither is installed unless you ask for it:

bash
npm install pixi.js   # PixiRenderer, in quantum-forge-engine/rendering
npm install howler    # AudioManager, in quantum-forge-engine/audio

npx quantum-forge-engine init my-game adds pixi.js for templates that render with it. If you add /rendering or /audio to a project by hand, run the install yourself.

Detailed references ​

  • Quantum API: quantum(), the Quantum handle, gates, measurement, recording, loading
  • Engine API: Engine base class
  • Rendering API: PixiRenderer, CanvasRenderer, GameLoop, Camera
  • Input API: InputManager, bindings, devices
  • Packages API: collision, audio, particles, animation, entities, state machine, timer, save, scenes

Powered by Quantum Forge