Okay I posted not long ago about path finding which i have finally had a look at, I understand how it works but cannot implement it into code
Can someone advice me on what i need to do next please
private ArrayList<Node> openList;
private ArrayList<Node> closedList;
public APathfind() {
openList = new ArrayList<Node>();
closedList = new ArrayList<Node>();
}
public void calculatePath(Vector2 start,Vector2 target,MasterTile[][] map){
openList.clear();
closedList.clear();
Node startNode = new Node();
openList.add(startNode);
}
Node
public float h; // Distance from a node to the target node (Manhatten)
public float g; // Movement cost from node to another node
public float f; // h+g
public Node parent;
public Node(float h,float g,float f) {
this.h = h;
this.g = g;
this.f = f;
}
public Node() {
this(0,0,0);
}