Component types provided by the timer plugin.
Each entity carries a single timers component whose value is a map of named slots. This lets one entity host independent phase clocks (e.g. { launch: ..., shieldDepletion: ..., hangarCycle: ... }) without one timer's lifecycle constraining another.
timers
{ launch: ..., shieldDepletion: ..., hangarCycle: ... }
const ecs = ECSpresso.create() .withPlugin(createTimerPlugin()) .withComponentTypes<{ fighter: true }>() .build();ecs.spawn({ fighter: true, timers: { launch: createTimer(2.0) },}); Copy
const ecs = ECSpresso.create() .withPlugin(createTimerPlugin()) .withComponentTypes<{ fighter: true }>() .build();ecs.spawn({ fighter: true, timers: { launch: createTimer(2.0) },});
Component types provided by the timer plugin.
Each entity carries a single
timerscomponent whose value is a map of named slots. This lets one entity host independent phase clocks (e.g.{ launch: ..., shieldDepletion: ..., hangarCycle: ... }) without one timer's lifecycle constraining another.Example