Class AStar

java.lang.Object
de.tum.cit.ase.maze.map.AStar

public class AStar extends Object
Class, that finds a path in a Grid using the A* Algorithm
  • 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 not
      start - Vector2 that defines the start position in the grid. Gets converted to a node
      end - 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