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

fix: #fe drop foe/clue on failure

parent cf2d2ee9
No related branches found
No related tags found
No related merge requests found
Pipeline #23599 passed with warnings
......@@ -213,6 +213,10 @@ export default class FightScene extends Phaser.Scene {
return result;
}
popFoe(foe) {
this.foes.splice(this.foes.indexOf(foe), 1);
}
submitTranscription(inputStatus: InputStatus) {
const { score, match } = this.findMatchingFoe(inputStatus.final);
// TODO: visual near misses based on score
......@@ -223,7 +227,7 @@ export default class FightScene extends Phaser.Scene {
this.showMissMessage();
new Spear(this, this.player, undefined);
} else {
this.foes.splice(this.foes.indexOf(match), 1);
this.popFoe(match);
match.handleSuccess();
this.showHitMessage();
new Spear(this, this.player, match.critter);
......
......@@ -41,6 +41,8 @@ class Foe {
this.critter,
() => {
this.scene.physics.world.removeCollider(overlap);
this.scene.popFoe(this);
this.clue.delete();
this.critter.escape();
},
);
......
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