Package de.tum.cit.ase.maze.map
Class AStar
java.lang.Object
de.tum.cit.ase.maze.map.AStar
Class, that finds a path in a
Grid
using the A* Algorithm-
Constructor Summary
-
Method Summary
-
Constructor Details
-
AStar
public AStar()
-
-
Method Details
-
findPath
public static List<Node> findPath(Grid grid, com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 end) Finds the path between nodes.- Parameters:
grid
-Grid
that defines all nodes e.g. if there is a wall or notstart
-Vector2
that defines the start position in the grid. Gets converted to a nodeend
-Vector2
that defines the end position in the grid. Gets converted to a node- Returns:
- List of nodes that represent the found path between start and end in the grid
-