Loom Engine - Examples

A browser-first 2D / 2.5D engine in TypeScript: ECS, Canvas2D primary backend, render-graph stages, Director-bridge SSE integration. The mini examples below are each ~150 lines, copy-paste-ready, and import from @sadhaka/loom-engine via an importmap. Source on GitHub; API docs at loom-engine.pages.dev.

Phase 14.2 starter examples

Survivor Mini

action / autobattler

Player at center auto-fires at the nearest mob; mobs spawn from random screen edges and pursue. Showcases ECS pools, MOB_CATALOG, projectile physics.

Plaza Mini

walking / iso / director

Walkable iso plaza with a mock Director bridge. Narrator overlay pulses every five seconds with a synthetic narrator.line event.

Dialogue Mini

UI / state machine

Branching dialogue tree, no movement, no combat. Demonstrates that the same ECS / resource model that runs the action demos also fits a UI-only game.

Plaza Multiplayer

phase 15.1 / presence + interp

Walkable iso plaza with three peers driven by a MockMultiplayerBridge. Showcases PeerPool linear interpolation between presence updates and the pluggable transport.

Reference demos

Director Demo

phase 6 / palette + tier loop

The Director-bridge novelty loop end-to-end: knot palette crossfades every 6s, VE tier shifts every 12s, audio + particle budgets gate same-tick.

Combat Slice

phase 7 / health, pursue, projectiles

Knight at origin with three pursuing mobs. Click to attack; dead enemies are cleaned up by DamageSystem. All three mob archetypes spawned via spawnMob.

ARPG First Slice

phase 8 / zone + interaction

Lastlight Plaza with a single NPC. WASD to walk; press E or Enter near the NPC to talk. Demonstrates the zone state, transition tick, interaction system.