Skip to content

Instantly share code, notes, and snippets.

View mhelf's full-sized avatar

Marius Helf mhelf

  • Marius Helf
  • Frankfurt, Germany
View GitHub Profile
@mhelf
mhelf / GetPath.java
Last active February 8, 2020 18:23
Function to determine the path between to tiles in a 2D world.
/**
* Calculates the path between two tiles.
*
* @param dst The destination tile of the path
* @param start The start tile of the path
* @return A list containing all tiles of the found path
*/
public ArrayList<Tile> getPath(Tile dst, Tile start) {
closed.clear();
open.clear();