diff options
| author | Simon O'Shea <osheas1@wit.edu> | 2023-08-08 21:53:26 -0400 |
|---|---|---|
| committer | Simon O'Shea <osheas1@wit.edu> | 2023-08-08 21:53:26 -0400 |
| commit | ce148072ef18fb0b33b0c9f3bef5629601f1d48f (patch) | |
| tree | 729be79d3908d8739220da25bf570de4749118a4 /Pathfinding Visualizer/Assets/Scripts/PathNode.cs | |
| parent | 82a6c82fe1080f84761fbae9d0472f4705899749 (diff) | |
everything is a mess
Diffstat (limited to 'Pathfinding Visualizer/Assets/Scripts/PathNode.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/PathNode.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Pathfinding Visualizer/Assets/Scripts/PathNode.cs b/Pathfinding Visualizer/Assets/Scripts/PathNode.cs index 9cd37fe..c69e821 100644 --- a/Pathfinding Visualizer/Assets/Scripts/PathNode.cs +++ b/Pathfinding Visualizer/Assets/Scripts/PathNode.cs @@ -50,10 +50,10 @@ using UnityEngine; //////////////////////////////////// // store coordinates for all potential moves to be checked - Vector2Int up = new Vector2Int( this.agent.y + 1, this.agent.x ); - Vector2Int down = new Vector2Int( this.agent.y - 1, this.agent.x ); - Vector2Int left = new Vector2Int( this.agent.y, this.agent.x - 1 ); - Vector2Int right = new Vector2Int( this.agent.y, this.agent.x + 1 ); + Vector2Int up = new Vector2Int( this.agent.x, this.agent.y + 1 ); + Vector2Int down = new Vector2Int( this.agent.x, this.agent.y - 1 ); + Vector2Int left = new Vector2Int( this.agent.x - 1, this.agent.y ); + Vector2Int right = new Vector2Int( this.agent.x + 1, this.agent.y); // make sure going up doesn't go outside world-bounds or into obstacle if (isOpen(up)) |
