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

feat: drop clues on correct guesses #fe

parent aa2642c1
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,17 @@ class Clue extends Phaser.GameObjects.Sprite { ...@@ -43,6 +43,17 @@ class Clue extends Phaser.GameObjects.Sprite {
duration: 100, duration: 100,
}); });
} }
delete() {
this.scene.tweens.add({
targets: this,
alpha: 0,
ease: "Linear",
delay: 0,
duration: 500,
});
this.destroy();
}
} }
export default Clue; export default Clue;
...@@ -185,13 +185,14 @@ export default class FightScene extends Phaser.Scene { ...@@ -185,13 +185,14 @@ export default class FightScene extends Phaser.Scene {
}); });
} }
shootSpear(enemy: Phaser.GameObjects.Sprite, hit: boolean) { shootSpear(enemy: Critter, hit: boolean) {
const scene = this; const scene = this;
if (!hit) { if (!hit) {
this.showMissMessage(); this.showMissMessage();
} else { } else {
this.showHitMessage(); this.showHitMessage();
// TODO: ew. // TODO: ew.
enemy.clue.delete();
scene.foes.splice(scene.foes.indexOf(enemy), 1); // FIXME scene.foes.splice(scene.foes.indexOf(enemy), 1); // FIXME
} }
......
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