fix waypoints going out of bounds
This commit is contained in:
+4
-4
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user