From fc9287000380228510938f30f8b72fc845bf149f Mon Sep 17 00:00:00 2001 From: Peter Date: Sat, 29 Jul 2023 09:49:46 +0200 Subject: [PATCH] refactor: move die sprite fadeOut to creatureSprite --- src/creature.ts | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/creature.ts b/src/creature.ts index ec348ea5a..4cf6f4ba7 100644 --- a/src/creature.ts +++ b/src/creature.ts @@ -1699,33 +1699,7 @@ export class Creature { } // Kill animation - const tweenSprite = game.Phaser.add - .tween(this.sprite) - .to( - { - alpha: 0, - }, - 500, - Phaser.Easing.Linear.None, - ) - .start(); - const tweenHealth = game.Phaser.add - .tween(this.healthIndicatorGroup) - .to( - { - alpha: 0, - }, - 500, - Phaser.Easing.Linear.None, - ) - .start(); - tweenSprite.onComplete.add(() => { - this.destroy(); - }); - tweenHealth.onComplete.add(() => { - this.healthIndicatorGroup.destroy(); - }); - + this.creatureSprite.setAlpha(0, 500).then(() => this.destroy()); this.cleanHex(); game.updateQueueDisplay();