Bonus fruit hitbox
This commit is contained in:
@@ -199,11 +199,11 @@ namespace Marro.PacManUdon
|
||||
|
||||
if (IsHorizontal(direction))
|
||||
{
|
||||
result = result || Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x);
|
||||
result = Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x);
|
||||
}
|
||||
if (IsVertical(direction))
|
||||
if (!result && IsVertical(direction))
|
||||
{
|
||||
result = result || Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y);
|
||||
result = Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -215,15 +215,11 @@ namespace Marro.PacManUdon
|
||||
|
||||
if (IsHorizontal(direction))
|
||||
{
|
||||
result = result || nextPosition.x != currentPosition.x
|
||||
&& ((Math.Floor(currentPosition.x) != Math.Floor(nextPosition.x) && nextPosition.x % 1 != 0)
|
||||
|| currentPosition.x % 1 == 0);
|
||||
result = Math.Round(currentPosition.x) != Math.Round(nextPosition.x);
|
||||
}
|
||||
if (IsVertical(direction))
|
||||
if (!result && IsVertical(direction))
|
||||
{
|
||||
result = result || nextPosition.y != currentPosition.y
|
||||
&& ((Math.Floor(currentPosition.y) != Math.Floor(nextPosition.y) && nextPosition.y % 1 != 0)
|
||||
|| currentPosition.y % 1 == 0);
|
||||
result = Math.Round(currentPosition.y) != Math.Round(nextPosition.y);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user