Fixed wrapping

This commit is contained in:
2026-06-17 13:09:34 +02:00
parent 97a3d90f14
commit e3b626f3d6
3 changed files with 7 additions and 988 deletions

View File

@@ -185,7 +185,9 @@ namespace Marro.PacManUdon
public static Vector2 GetNextPosition(Vector2 currentPosition, Vector2 directionVector, float speed, float deltaTime)
{
return currentPosition + deltaTime * speed * directionVector;
var nextPosition = currentPosition + deltaTime * speed * directionVector;
nextPosition = new Vector2((nextPosition.x + 32) % 32, (nextPosition.y + 32) % 32);
return nextPosition;
}
public static Vector2 PositionToGrid(Vector2 position)