fix waypoints going out of bounds

This commit is contained in:
2025-01-10 23:47:58 +09:00
parent fe4dc8b8bc
commit f1c191f61f
3 changed files with 30 additions and 33 deletions
+4 -4
View File
@@ -42,14 +42,14 @@ export default class Game {
}
}
async start() {
start() {
const start = performance.now()
await this.update()
this.update()
setTimeout(() => this.start(), Math.max(0, this.#tickBudget - (performance.now() - start)))
}
async update() {
Promise.allSettled(this.#entities.map((e) => e.update()))
update() {
this.#entities.map((e) => e.update())
this.currentTick++
this.eventEmitter.emit('tick')
}