Manual
What each module is for, when you would reach for it, and how it fits with the rest of the engine.
Read the manualThe core is domain-neutral: it knows nothing about players, enemies, or tiles. Genre-specific helpers live in modules you opt into, each a separate subpath import, so unused code stays out of your bundle.
Manual
What each module is for, when you would reach for it, and how it fits with the rest of the engine.
Read the manualAPI reference
Every public export, with its full type signature, its JSDoc summary, and a link to the exact source line.
Browse the referenceExamples
Runnable games and harnesses, each playable in place next to its source and the modules it uses.
Play the examplesThe engine is pre-release (0.0.0) and not published to npm. Consume it as a
sibling folder via a file: install — the package’s exports map points at
TypeScript sources, so no build step is needed for a TS-aware bundler.
import { simpleComponent } from '@pierre/ecs/component-store';import { HashGrid2D } from '@pierre/ecs/modules/spatial';import { EcsWorld } from '@pierre/ecs/world';
interface Pos { x: number; y: number }const PosDef = simpleComponent<Pos>('pos', { x: 'number', y: 'number' });
const world = new EcsWorld();world.registerComponent(PosDef);world.enableSpatial(PosDef, new HashGrid2D());
const id = world.spawn({ name: 'marker', components: { pos: { x: 0, y: 0 } } });world.move(id, 3, 4);
for (const [entity, pos] of world.query(PosDef)) { console.log(entity, pos.x, pos.y);}