More use of Direction
This commit is contained in:
@@ -20,304 +20,304 @@ namespace Marro.PacManUdon
|
||||
break;
|
||||
case 2:
|
||||
// Setup ghosts
|
||||
ghostManager.Ghosts[0].SetPredefinedPath(new Vector2[]{ // Blinky
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
ghostManager.Ghosts[0].SetPredefinedPath(new Direction[]{ // Blinky
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
// Goes through tunnel
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
// Gets eaten
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
});
|
||||
|
||||
ghostManager.Ghosts[1].SetPredefinedPath(new Vector2[]{ // Pinky
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
ghostManager.Ghosts[1].SetPredefinedPath(new Direction[]{ // Pinky
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
// Pellet starts
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
// Pellet ends
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
// Pellet starts
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
// Caught
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
// Home
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
// Power pellet active
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down
|
||||
});
|
||||
|
||||
ghostManager.Ghosts[2].SetPredefinedPath(new Vector2[]{ // Inky
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
ghostManager.Ghosts[2].SetPredefinedPath(new Direction[]{ // Inky
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
// Pellet starts
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
// Caught
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left
|
||||
});
|
||||
|
||||
ghostManager.Ghosts[3].SetPredefinedPath(new Vector2[]{ // Clyde
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right
|
||||
ghostManager.Ghosts[3].SetPredefinedPath(new Direction[]{ // Clyde
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right
|
||||
});
|
||||
|
||||
pacMan.SetPredefinedPath(new Vector2[]{
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.zero,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.zero,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.down,
|
||||
Vector2.right,
|
||||
Vector2.down,
|
||||
Vector2.left,
|
||||
Vector2.zero,
|
||||
Vector2.zero,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
Vector2.up,
|
||||
Vector2.left,
|
||||
Vector2.up,
|
||||
Vector2.right,
|
||||
pacMan.SetPredefinedPath(new Direction[]{
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Zero,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Zero,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Up,
|
||||
Direction.Right,
|
||||
Direction.Up,
|
||||
Direction.Left,
|
||||
Direction.Zero,
|
||||
Direction.Zero,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
Direction.Down,
|
||||
Direction.Left,
|
||||
Direction.Down,
|
||||
Direction.Right,
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Marro.PacManUdon
|
||||
case 18:
|
||||
// Turn PacMan around after eating power pellet
|
||||
pacMan.SetDirection(Direction.Right);
|
||||
pacMan.SetTargetDirection(Vector2.right);
|
||||
pacMan.SetTargetDirection(Direction.Right);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
|
||||
Reference in New Issue
Block a user