export const BOSS_DEATH_HOLD_SECONDS = 2.5;
export const BOSS_DEATH_FADE_SECONDS = 0.75;
export const BOSS_DEATH_DESPAWN_SECONDS = BOSS_DEATH_HOLD_SECONDS + BOSS_DEATH_FADE_SECONDS;

export function bossDeathOpacity(elapsedSeconds: number) {
  if (elapsedSeconds <= BOSS_DEATH_HOLD_SECONDS) return 1;
  return Math.max(0, 1 - (elapsedSeconds - BOSS_DEATH_HOLD_SECONDS) / BOSS_DEATH_FADE_SECONDS);
}
