Files
PacManUdon/Assets/Scripts/Sequences/PacManCaught.cs
2025-12-14 17:05:24 +01:00

51 lines
1.7 KiB
C#

namespace Marro.PacManUdon
{
public partial class GameManager
{
private void TimeSequenceStepPacManCaught(int sequenceProgress)
{
switch (sequenceProgress)
{
case 0:
// Freeze (except for the ghost animations)
SetFrozen(true, ghostKeepAnimating: true);
soundManager.StopAllSound();
break;
case 1:
// Hide ghosts, start pacman death animation
SetGhostsActive(false);
pacMan.SetDead(true);
break;
case 2:
// Start playing death sound
soundManager.PlayDeathSound();
break;
case 3:
// Hide pacman, start next state
SetPacManActive(false);
if (gameState == PacManGameState.AttractModeDemo)
{
break;
}
if (extraLives > 0)
{
InsertTimeSequence(PacManTimeSequence.RestartLevel);
break;
}
InsertTimeSequence(PacManTimeSequence.GameOver);
break;
case 4:
if (gameState == PacManGameState.AttractModeDemo)
{
#if RECORDING_DEMO
// recorder.gameObject.SetActive(false);
#endif
InsertTimeSequence(PacManTimeSequence.AttractScreenIntroduction);
}
break;
}
}
}
}