Ghost - PacMan collision detection

This commit is contained in:
2026-06-17 14:12:36 +02:00
parent e3b626f3d6
commit a7d1adf175
6 changed files with 302 additions and 127 deletions

View File

@@ -61,7 +61,7 @@ namespace Marro.PacManUdon
ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, pelletManager, this);
pacMan.Initialize(playerInput, maze.pacManStart, this, pelletManager);
bonusFruit.Initialize();
pelletManager.Initialize(this, bonusFruit);
pelletManager.Initialize(this, bonusFruit, ghostManager.Ghosts);
statusDisplay.Initialize();
playerInput.Initialize(this);
soundManager.Initialize();
@@ -163,9 +163,9 @@ namespace Marro.PacManUdon
SetFrozen(true);
}
internal void GotPellet(Pellet pellet, PelletType pelletType, int pelletsCollectedCount, int pelletsRemainingCount)
internal void GotPellet(Pellet pellet, bool isPowerPellet, int pelletsCollectedCount, int pelletsRemainingCount)
{
AddScore(pelletType == PelletType.PowerPellet ? 50 : 10);
AddScore(isPowerPellet ? 50 : 10);
ghostManager.PelletConsumed(pelletsRemainingCount);
@@ -178,7 +178,7 @@ namespace Marro.PacManUdon
return;
}
if (pelletType == PelletType.PowerPellet)
if (isPowerPellet)
{
if (gameState == PacManGameState.AttractMode)
{
@@ -234,7 +234,7 @@ namespace Marro.PacManUdon
public void PacManCaught()
{
return;
//return;
StartTimeSequence(PacManTimeSequence.PacManCaught);
}