コード例 #1
0
ファイル: ai.py プロジェクト: Mattias-/mmc-Taylor-Swift
 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
コード例 #2
0
ファイル: __init__.py プロジェクト: JKatzwinkel/sym_comm
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)
コード例 #3
0
ファイル: __init__.py プロジェクト: JKatzwinkel/sym_comm
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)
コード例 #4
0
ファイル: ui.py プロジェクト: MarGarza/MyGame
 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()