From 5b8513d044457e6accd6d03f1589e75ad3b2fd2b Mon Sep 17 00:00:00 2001 From: Josh Curtiss Date: Fri, 7 Jun 2024 16:37:33 -0500 Subject: [PATCH] fix: Freeze enemies when you die or win --- src/scenes/GameScene.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index 0eacc79..a5ef529 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -230,11 +230,13 @@ export default function(options: Partial) { player.isAlive = true; player.isFrozen = true; on(ON_DIE, 'player', ()=>{ + enemies.forEach(enemy=>enemy.freeze()); wait(0.5, ()=>music.stop()); wait(5, ()=>goNextScene('die')); }); on(ON_WIN, 'player', ()=>{ music.stop(); + enemies.forEach(enemy=>enemy.freeze()); wait(5, ()=>goNextScene('win')); });