@roost2d/core
v0.7.0
Published
Runtime-neutral lifecycle, events, and frame scheduling primitives for Roost2D.
Readme
@roost2d/core
Renderer-neutral deterministic runtime primitives: scenes, fixed updates, events, services, scheduling, object pools, and seeded random.
npm install @roost2d/coreimport { GameRuntime } from '@roost2d/core';
const runtime = new GameRuntime({ stepMs: 1000 / 60, seed: 42 });
runtime.registerScene('play', () => ({ id: 'play', fixedUpdate() {}, render() {} }));
await runtime.switchScene('play');
runtime.start();Call runtime.dispose() when its application owner is removed. Complete quick start.
Long-running deterministic sessions can serialize a bounded random cursor without changing the historical sequence:
import { SeededRandom } from '@roost2d/core';
const random = new SeededRandom(42);
const checkpoint = random.checkpoint(); // JSON-safe { seed, draws }
const restored = SeededRandom.fromCheckpoint(checkpoint);