Clockwork

Clockwork is a TypeScript-first, modular game engine workspace focused on ECS-driven runtime systems and a WebGL2 renderer stack.

Scheduler Systems

Scheduler Systems

Systems run through Scheduler.addSystem(stage, system, order?).

System Contract

const system = {
  id: 'example.system',
  stage: 'Update',
  order: 100,
  reads: [],
  writes: [],
  runIf(world) {
    return true
  },
  execute(ctx) {}
}

Context

execute(ctx) receives:

  • world
  • deltaTime
  • commands
  • events
  • resources

Lifecycle Control

  • run() starts stepping behavior
  • pause()/resume() gate stepping
  • shutdown() runs shutdown stage and stops scheduler

Utility Types

  • Profiler for runtime timings
  • SeededRng for deterministic randomness
  • DeterminismValidator for risk checks
Last updated: February 17, 2026