Fixed PacMan speed
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
@@ -9,7 +8,7 @@ namespace Marro.PacManUdon
|
||||
Moving,
|
||||
Stopped,
|
||||
Big,
|
||||
Dead,
|
||||
Dead,
|
||||
}
|
||||
|
||||
enum PacManState
|
||||
@@ -290,6 +289,7 @@ namespace Marro.PacManUdon
|
||||
// Debug.Log($"{gameObject} SetLevel {level}");
|
||||
defaultSpeed = PacManConstants.GetPacManDefaultSpeedForLevel(level);
|
||||
powerPelletSpeed = PacManConstants.GetPacManPowerPelletSpeedForLevel(level);
|
||||
UpdateSpeed();
|
||||
}
|
||||
|
||||
public void SetPowerPellet(bool powerPellet)
|
||||
@@ -357,6 +357,7 @@ namespace Marro.PacManUdon
|
||||
state = (PacManState)data.ReadByte(ref index);
|
||||
freezeSeconds = data.ReadFloat(ref index);
|
||||
frozen = data.ReadBool(ref index);
|
||||
|
||||
UpdateSpeed();
|
||||
|
||||
return base.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
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;
|
||||
networkManager.SendEventSoon(NetworkEventType.InputChange, true);
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
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;
|
||||
if (normalized.x > directionDivider)
|
||||
|
||||
Reference in New Issue
Block a user