Skip to content
Snippets Groups Projects
Commit eba81f44 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

fix: #fe remove spawner at game over

parent 50b52ab9
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,7 @@ export default class FightScene extends Phaser.Scene { ...@@ -47,6 +47,7 @@ export default class FightScene extends Phaser.Scene {
gameTime: Phaser.Time.TimerEvent; gameTime: Phaser.Time.TimerEvent;
uiDimensions: UIDimensions; uiDimensions: UIDimensions;
music!: Phaser.Sound.BaseSound; music!: Phaser.Sound.BaseSound;
spawner: Phaser.Time.TimerEvent;
constructor() { constructor() {
super("fight"); super("fight");
...@@ -352,6 +353,7 @@ export default class FightScene extends Phaser.Scene { ...@@ -352,6 +353,7 @@ export default class FightScene extends Phaser.Scene {
ended_at_gmtm: this.getGameTime(), ended_at_gmtm: this.getGameTime(),
}) })
).data; ).data;
this.spawner.remove();
this.foes.forEach((foe) => foe.destroy()); this.foes.forEach((foe) => foe.destroy());
this.sound.play("sfx_game_over"); this.sound.play("sfx_game_over");
this.typewriter.setActive(false); this.typewriter.setActive(false);
...@@ -465,7 +467,7 @@ export default class FightScene extends Phaser.Scene { ...@@ -465,7 +467,7 @@ export default class FightScene extends Phaser.Scene {
(8 * 1000 * (60 * 1000 - this.getGameTime())) / 60 / 1000 + 2 * 1000, (8 * 1000 * (60 * 1000 - this.getGameTime())) / 60 / 1000 + 2 * 1000,
); );
// TODO: it should be ok calling this on time instead of gameTime, but... is it? // TODO: it should be ok calling this on time instead of gameTime, but... is it?
this.time.delayedCall(delay, this.spawnFoes.bind(this)); this.spawner = this.time.delayedCall(delay, this.spawnFoes.bind(this));
} }
async spawnFoe() { async spawnFoe() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment