Initial progress syncing + many existing bugs

This commit is contained in:
2026-01-15 23:00:15 +01:00
parent fb902aaddc
commit c41491e55e
11 changed files with 345 additions and 230 deletions

View File

@@ -55,17 +55,17 @@ namespace Marro.PacManUdon
private bool kinematic;
// This should be called once when the game is initialized
public void Initialize(GameObject[] ghostTargets, PacMan pacMan, GameManager gameController)
public void Initialize(Transform[] ghostTargets, PacMan pacMan, GameManager gameController)
{
this.gameController = gameController;
ghosts = transform.GetComponentsInChildren<Ghost>(true);
blinky = ghosts[0];
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{
Vector2 homePosition = ghostTargets[0].transform.localPosition;
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].transform.localPosition;
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].transform.localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].transform.localPosition;
Vector2 homePosition = ghostTargets[0].localPosition;
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].localPosition;
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
ghosts[ghostIndex].Initialize(pacMan, blinky, homePosition, idlePosition1, idlePosition2, cornerPosition);
}