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

fix: #fe reset typewriter on game over

parent 4df82232
No related branches found
No related tags found
No related merge requests found
...@@ -357,6 +357,7 @@ export default class FightScene extends Phaser.Scene { ...@@ -357,6 +357,7 @@ export default class FightScene extends Phaser.Scene {
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);
this.typewriter.resetInputStatus();
this.scene.start("game_over", { music: this.music }); this.scene.start("game_over", { music: this.music });
} }
......
...@@ -199,7 +199,6 @@ class Typewriter { ...@@ -199,7 +199,6 @@ class Typewriter {
if (this.inputStatus.began_at_gmtm === null) if (this.inputStatus.began_at_gmtm === null)
this.inputStatus.began_at_gmtm = this.getGameTime(); this.inputStatus.began_at_gmtm = this.getGameTime();
if (key === Key.Enter) { if (key === Key.Enter) {
this.keyboard.clearInput();
this.inputStatus.typed += "\n"; this.inputStatus.typed += "\n";
this.inputStatus.ended_at = new Date(); this.inputStatus.ended_at = new Date();
this.inputStatus.ended_at_gmtm = this.getGameTime(); this.inputStatus.ended_at_gmtm = this.getGameTime();
...@@ -222,6 +221,7 @@ class Typewriter { ...@@ -222,6 +221,7 @@ class Typewriter {
} }
resetInputStatus() { resetInputStatus() {
this.keyboard.clearInput();
this.inputStatus = { this.inputStatus = {
began_at: null, began_at: null,
ended_at: null, ended_at: null,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment