Skip to content

Commit

Permalink
refactor: move die sprite fadeOut to creatureSprite
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Jul 29, 2023
1 parent 3defc2e commit fc92870
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fc92870

Please sign in to comment.