diff --git a/frontend/src/js/clue.ts b/frontend/src/js/clue.ts index d13ab82c1a40b65cc931c6faf733487e1ee657dd..04cc261a9b17ea7f0bdb605de9741ddd94f1a81b 100644 --- a/frontend/src/js/clue.ts +++ b/frontend/src/js/clue.ts @@ -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; diff --git a/frontend/src/js/fight_scene.ts b/frontend/src/js/fight_scene.ts index ec046f6b5a563f2ed3d160b79493d8d860a76b09..315ee859087ce5d4e60b0a445e8599006fa7bb86 100644 --- a/frontend/src/js/fight_scene.ts +++ b/frontend/src/js/fight_scene.ts @@ -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 }