summaryrefslogtreecommitdiff
path: root/pathfinding.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-21 17:04:01 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-21 17:04:01 +0200
commitc4104a5cd33275c0ae79530e182c4538c9d3f2f3 (patch)
tree9642d5be4bfedeb21974e669c0b24bd2d1bc41e2 /pathfinding.py
parentb88f390df3bc48059149c8d8ac8172527ccd54b6 (diff)
8-connected graph instead of 4-connected
Diffstat (limited to 'pathfinding.py')
-rw-r--r--pathfinding.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pathfinding.py b/pathfinding.py
index ce3ab8e..2b6a7aa 100644
--- a/pathfinding.py
+++ b/pathfinding.py
@@ -22,7 +22,7 @@ class Node:
def siblings(point,grid):
x,y = point.point_in_grid
- links = [grid[d[0]][d[1]] for d in [(x-1, y),(x,y - 1),(x,y + 1),(x+1,y)]]
+ links = [grid[d[0]][d[1]] for d in [(x-1, y),(x-1,y-1),(x,y - 1),(x+1,y-1),(x+1,y),(x+1,y+1),(x,y + 1),(x-1,y+1)]]
return [link for link in links if link.value != None]
def distance(point,point2):