Removed A* debug text

This commit is contained in:
Marcin Kostrzewski 2020-05-17 00:15:56 +02:00
parent b9997a0a93
commit 2afbcdaff8

View File

@ -129,7 +129,7 @@ def aStar(movable: Entity, target, map):
:return: Array of moves :return: Array of moves
""" """
testCount = 0 testCount = 0
print("Finding path to x:", target.x, " y:", target.y, end='...\n') # print("Finding path to x:", target.x, " y:", target.y, end='...\n')
fringe = PriorityQueue() fringe = PriorityQueue()
explored = [] explored = []
@ -141,13 +141,13 @@ def aStar(movable: Entity, target, map):
while True: while True:
if fringe.empty(): if fringe.empty():
# target is unreachable # target is unreachable
print("Couldn't find path to x:", target.x, " y:", target.y, end='.\n') # print("Couldn't find path to x:", target.x, " y:", target.y, end='.\n')
return None return None
elem: AStarNode = fringe.get()[2] elem: AStarNode = fringe.get()[2]
if goalTest(elem.state, target): if goalTest(elem.state, target):
print("Found path to x:", target.x, " y:", target.y, end='.\n') # print("Found path to x:", target.x, " y:", target.y, end='.\n')
movesList = [] movesList = []
if isinstance(target, Entity) or target in map.collidables: if isinstance(target, Entity) or target in map.collidables: