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 {
duration: 100,
});
}
delete() {
this.scene.tweens.add({
targets: this,
alpha: 0,
ease: "Linear",
delay: 0,
duration: 500,
});
this.destroy();
}
}
export default Clue;
......@@ -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;
if (!hit) {
this.showMissMessage();
} else {
this.showHitMessage();
// TODO: ew.
enemy.clue.delete();
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