a start 从这篇教程学的
作者是个很细心的人 讲得很细
http://www.cnblogs.com/alamiye010/archive/2009/06/17/1505339.html
package ljh.game.geom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class AStarFinder {
public class Node
{
public Node(int x,int y)
{
this.x = x;
this.y = y;
}
public int x,y;
public Node parent;
public int G;
public int H;
public int F;
public boolean equals(int x,int y)
{
return this.x==x&&this.y==y;
}
}
/**
* 开闭 集合
*/
public ArrayList<Node> OpenList = new ArrayList<AStarFinder.Node>();
public ArrayList<Node> CloseList = new ArrayList<AStarFinder.Node>();
/**
* 方向
*/
private final static int[] XMove = {0,-1,0,1,-1,-1,1,1};
private final static int[] Y