CoolFace
Apppublic

Omnibus-archive/sim-1

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
index.js44 linesDownload Raw Back to simulation
1export default class simulation {2  constructor (options) {3    this.scene = options.scene;4    this.common = this.scene.sys.game.common;5    this.sims = [];6    this.simTick = 0;7 8    this.paused = false;9 10    this.timer = this.scene.time.addEvent({11      delay: 1000,12      callback: () => { this.tick(); },13      cellbackScope: this,14      loop: true15    });16  }17 18  tick () {19    if (this.paused)20      return;21 22    this.sims.forEach((sim) => {23      24    });25 26    this.simTick++;27  }28 29  register () {30 31  }32 33  deregister () {34    35  }36 37  sleep () {38    this.paused = true;39  }40 41  wake () {42    this.paused = false;43  }44}