Fixed wrapping
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user