PrepareForCutscene

This commit is contained in:
2025-12-26 18:27:04 +01:00
parent a15f977107
commit 129ef16714
10 changed files with 25 additions and 24 deletions

View File

@@ -192,6 +192,13 @@ namespace Marro.PacManUdon
pelletManager.SetPowerPelletsBlink(false);
}
private void PrepareForCutscene()
{
HideEverything();
RestartLevel();
SetFrozen(true);
}
public void GotPellet(bool addScore = true)
{
pelletCountRemaining--;

View File

@@ -329,7 +329,7 @@
for (int i = 0; i < ghosts.Length; i++)
{
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
ghosts[i].Reset(); // Reset needed to properly apply level
Reset(); // Reset needed to properly apply level
}
}

View File

@@ -9,9 +9,9 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
SetGameState(PacManGameState.AttractModeDemo);
HideEverything();
SetFrozen(true);
break;
case 1:
InitializeLevel();
@@ -19,9 +19,7 @@ namespace Marro.PacManUdon
SetLevel(1);
break;
case 2:
// Reset ghosts
RestartLevel();
// Setup ghosts
ghostManager.Ghosts[0].SetPredefinedPath(new Vector2[]{ // Blinky
Vector2.down,
Vector2.left,

View File

@@ -9,13 +9,12 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
SetGameState(PacManGameState.AttractMode);
// Initialize
soundManager.SuppressSound(true);
RestartLevel();
HideEverything();
SetFrozen(true);
attractScreen.gameObject.SetActive(true);
attractScreen.Initialize();
for (int i = 0; i <= 15; i++)

View File

@@ -11,8 +11,9 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
// Show just level display
RestartLevel();
statusDisplay.SetLevelDisplayVisible(true);
break;
case 1:
@@ -20,7 +21,6 @@ namespace Marro.PacManUdon
soundManager.SuppressSound(false);
soundManager.StartIntermissionSound();
pacMan.Reset();
pacMan.SetLevel(4);
pacMan.SetPowerPellet(false); // Update speed
pacMan.SetKinematic(true);
@@ -28,7 +28,6 @@ namespace Marro.PacManUdon
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Vector2.left);
ghostManager.Reset();
ghostManager.SetLevel(5);
ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true);

View File

@@ -11,8 +11,9 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
// Show just level display
RestartLevel();
statusDisplay.SetLevelDisplayVisible(true);
break;
case 1:
@@ -27,7 +28,6 @@ namespace Marro.PacManUdon
break;
case 3:
// Start animation, pacman running and blinky prepared to chase
pacMan.Reset();
pacMan.SetLevel(4);
pacMan.SetPowerPellet(false); // Update speed
pacMan.SetKinematic(true);
@@ -35,7 +35,6 @@ namespace Marro.PacManUdon
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Vector2.left);
ghostManager.Reset();
ghostManager.SetLevel(5);
ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true);

View File

@@ -11,8 +11,9 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
// Show just level display
RestartLevel();
statusDisplay.SetLevelDisplayVisible(true);
break;
case 1:
@@ -20,7 +21,6 @@ namespace Marro.PacManUdon
soundManager.SuppressSound(false);
soundManager.StartIntermissionSound();
pacMan.Reset();
pacMan.SetLevel(4);
pacMan.SetPowerPellet(false); // Update speed
pacMan.SetKinematic(true);
@@ -28,7 +28,6 @@ namespace Marro.PacManUdon
pacMan.SetPosition(intermissionScreenElements[0].transform.localPosition);
pacMan.SetDirection(Vector2.left);
ghostManager.Reset();
ghostManager.SetLevel(5);
ghostManager.SetKinematic(true);
ghostManager.gameObject.SetActive(true);

View File

@@ -12,12 +12,10 @@ namespace Marro.PacManUdon
// Prepare new game, hide everything except score bar
gameState = PacManGameState.InGame;
HideEverything();
InitializeNewGame();
InitializeLevel();
RestartLevel();
SetFrozen(true);
PrepareForCutscene();
soundManager.SuppressSound(false);
soundManager.PlayGameStartSound();
break;

View File

@@ -7,9 +7,10 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
// Reset, show maze and score display
InitializeLevel();
RestartLevel();
SetMazeVisible(true);
statusDisplay.SetScoreDisplayVisible(true);
break;

View File

@@ -7,8 +7,9 @@ namespace Marro.PacManUdon
switch (sequenceProgress)
{
case 0:
PrepareForCutscene();
SetGameState(PacManGameState.WaitForStart);
HideEverything();
soundManager.SuppressSound(false);
soundManager.PlayCoinSound();
break;