Fixed PacMan speed

This commit is contained in:
2026-06-23 18:18:17 +02:00
parent 875d0ad5f0
commit 3be8d2f6a6
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,4 @@
using System; using UnityEngine;
using UnityEngine;
namespace Marro.PacManUdon namespace Marro.PacManUdon
{ {
@@ -9,7 +8,7 @@ namespace Marro.PacManUdon
Moving, Moving,
Stopped, Stopped,
Big, Big,
Dead, Dead,
} }
enum PacManState enum PacManState
@@ -290,6 +289,7 @@ namespace Marro.PacManUdon
// Debug.Log($"{gameObject} SetLevel {level}"); // Debug.Log($"{gameObject} SetLevel {level}");
defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level); defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level);
powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level); powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level);
UpdateSpeed();
} }
public void SetPowerPellet(bool powerPellet) public void SetPowerPellet(bool powerPellet)
@@ -357,6 +357,7 @@ namespace Marro.PacManUdon
state = (PacManState)data.ReadByte(ref index); state = (PacManState)data.ReadByte(ref index);
freezeSeconds = data.ReadFloat(ref index); freezeSeconds = data.ReadFloat(ref index);
frozen = data.ReadBool(ref index); frozen = data.ReadBool(ref index);
UpdateSpeed(); UpdateSpeed();
return base.WriteSyncedData(data, ref index, eventType); return base.WriteSyncedData(data, ref index, eventType);

View File

@@ -160,7 +160,7 @@
return; return;
} }
Debug.Log($"Switched to input direction {newResult} from analogInput {analogInput} with HorizontalPriority {horizontalPriority}"); //Debug.Log($"Switched to input direction {newResult} from analogInput {analogInput} with HorizontalPriority {horizontalPriority}");
resultInput = newResult; resultInput = newResult;
networkManager.SendEventSoon(NetworkEventType.InputChange, true); networkManager.SendEventSoon(NetworkEventType.InputChange, true);
@@ -199,7 +199,7 @@
var normalized = analogInput.normalized; var normalized = analogInput.normalized;
Debug.Log($"Checking analogInput {analogInput} with HorizontalPriority {horizontalPriority}, normalized {normalized}"); //Debug.Log($"Checking analogInput {analogInput} with HorizontalPriority {horizontalPriority}, normalized {normalized}");
const float directionDivider = 0.72f; const float directionDivider = 0.72f;
if (normalized.x > directionDivider) if (normalized.x > directionDivider)