export class Ticker { constructor() { this.callbacks = []; } subscribe(fn) { this.callbacks.push(fn); } tick(delta, elapsed) { this.callbacks.forEach(fn => fn(delta, elapsed)); } } export const globalTicker = new Ticker();