Ejemplo n.º 1
0
 def move_to_pos(self, pos):
     path = pathfinder.astar(self.layout, self.current_pos, pos,
                             self.tunnels, self.full_inventory(),
                             blocking_blocks=['monkey'])
     if not path:
         raise Exception('No path found')
     return path
Ejemplo n.º 2
0
def find_path(orig, dest):
	"""
	Returns a pathfinder instance?"""
	#x,y=orig.pos
	#orig = surface.tile(x,y)
	#x,y=dest.pos
	#dest = surface.tile(x,y)
	return pathfinder.astar(orig, dest)
Ejemplo n.º 3
0
def find_path(orig, dest):
    """
	Returns a pathfinder instance?"""
    # x,y=orig.pos
    # orig = surface.tile(x,y)
    # x,y=dest.pos
    # dest = surface.tile(x,y)
    return pathfinder.astar(orig, dest)
Ejemplo n.º 4
0
 def find_enemy_move(self, start, goal, space, enemy_symbol, player_symbol):
     """uses input to run pathfinder and return next move"""
     path = pathfinder.astar(self._screen, start, goal, self._map_dims, space, enemy_symbol, player_symbol)
     return path.get_shortest_path()