From 028800c0bb394319bbb10a8e69a9d8d0bcb1c9db Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Jan 2024 20:32:40 +0900 Subject: [PATCH] Update drop-and-fusion-engine.ts --- packages/frontend/src/scripts/drop-and-fusion-engine.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/scripts/drop-and-fusion-engine.ts b/packages/frontend/src/scripts/drop-and-fusion-engine.ts index f9232a417e..a095c1f9d3 100644 --- a/packages/frontend/src/scripts/drop-and-fusion-engine.ts +++ b/packages/frontend/src/scripts/drop-and-fusion-engine.ts @@ -424,7 +424,9 @@ export class DropAndFusionGame extends EventEmitter<{ Matter.Engine.update(this.engine, this.TICK_DELTA); - this.tickRaf = window.requestAnimationFrame(playTick); + if (!this.isGameOver) { + this.tickRaf = window.requestAnimationFrame(playTick); + } }; playTick(); @@ -448,7 +450,9 @@ export class DropAndFusionGame extends EventEmitter<{ } }); Matter.Engine.update(this.engine, this.TICK_DELTA); - this.tickRaf = window.requestAnimationFrame(this.tick); + if (!this.isGameOver) { + this.tickRaf = window.requestAnimationFrame(this.tick); + } } public async load() {