Pellet collision
This commit is contained in:
@@ -105,7 +105,7 @@ namespace Marro.PacManUdon
|
||||
public void NewLevel()
|
||||
{
|
||||
SetSharedPelletCounterActive(false);
|
||||
UpdateElroyLevel();
|
||||
UpdateElroyLevel(pelletManager.PelletCount);
|
||||
foreach (Ghost ghost in ghosts)
|
||||
{
|
||||
ghost.ResetHousePelletCounter();
|
||||
@@ -404,11 +404,11 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
public void PelletConsumed()
|
||||
public void PelletConsumed(int pelletsRemainingCount)
|
||||
{
|
||||
pelletTimeout = 0;
|
||||
|
||||
UpdateElroyLevel();
|
||||
UpdateElroyLevel(pelletsRemainingCount);
|
||||
|
||||
if (sharedPelletCounterActive)
|
||||
{
|
||||
@@ -452,14 +452,13 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateElroyLevel()
|
||||
void UpdateElroyLevel(int pelletsRemainingCount)
|
||||
{
|
||||
// Debug.Log($"{gameObject} Updating Elroy Level with pelletsRemaining {pelletsRemaining} with elroy2PelletCount {elroy2PelletCount} and elroy1PelletCount {elroy1PelletCount}");
|
||||
var oldElroyLevel = elroyLevel;
|
||||
|
||||
var pelletsRemaining = pelletManager.PelletCount - pelletManager.PelletCollectedCount;
|
||||
if (pelletsRemaining < elroy2PelletCount) elroyLevel = 2;
|
||||
else if (pelletsRemaining < elroy1PelletCount) elroyLevel = 1;
|
||||
if (pelletsRemainingCount < elroy2PelletCount) elroyLevel = 2;
|
||||
else if (pelletsRemainingCount < elroy1PelletCount) elroyLevel = 1;
|
||||
else elroyLevel = 0;
|
||||
|
||||
if (elroyLevel != oldElroyLevel)
|
||||
|
||||
Reference in New Issue
Block a user