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); }