Search code examples
javaandroidpath-finding

android java A* Pathfinding help needed


I have come across the following link: http://code.google.com/p/a-star/source/browse/trunk/java/PathFinder.java?r=8 I have got the code working ok as a test but I am unsure how you change the destination node -- the default is bottom right but I am unsure how you would change it to a different row/column thanks


Solution

  • it seems that the goal is defined in the function

                protected boolean isGoal(Node node){
                                return (node.x == map[0].length - 1) && (node.y == map.length - 1);
                }
    

    change it to your needs.