23 lines
435 B
JavaScript
23 lines
435 B
JavaScript
const {Sprite, Ticking, Vulnerable} = entity;
|
|
if (Vulnerable) {
|
|
Vulnerable.isInvulnerable = 1;
|
|
}
|
|
if (Sprite) {
|
|
const {promise} = transition(
|
|
entity.Sprite,
|
|
{
|
|
scaleX: {
|
|
duration: 0.25,
|
|
magnitude: -entity.Sprite.scaleX,
|
|
},
|
|
scaleY: {
|
|
duration: 0.25,
|
|
magnitude: entity.Sprite.scaleY * 2,
|
|
},
|
|
},
|
|
)
|
|
Ticking.add(promise);
|
|
await promise;
|
|
ecs.destroy(entity.id);
|
|
}
|