Skip to content

Commit

Permalink
fix: Freeze enemies when you die or win
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacurtiss committed Jun 7, 2024
1 parent 362bbdc commit 5b8513d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scenes/GameScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@ export default function(options: Partial<GameSceneOpt>) {
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'));
});

Expand Down

0 comments on commit 5b8513d

Please sign in to comment.