I have an instance variable, like so:
PathFinder finder;
(this is using Kevin Glass’ A* tutorial, so the PathFinder class is in the same file, link here: http://cokeandcode.com/index.html?page=tutorials/tilemap2)
Anyways, when I do
finder = new AStarPathFinder(currentMap, 1000, true);
I get a Exception in thread “”AWT-EventQueue-0″ java.lang.ExceptionInInitializerError”.
currentMap is an instance of my Map class, and yes it is initialized. 1000 represents the maximum tile distance that will be searched, and the boolean represents diagonal movement true/false. Oh well I’ll just throw the constructor at you:
public AStarPathFinder(TileBasedMap map, int maxSearchDistance, boolean allowDiagMovement) {
this(map, maxSearchDistance, allowDiagMovement, new ClosestHeuristic());
}
I know it has something to do with static initializers, but I’m not too sure what else. Oh, and I tried to initialize an instance of the same AStarPathFinder class in another class, and I got the same result.
I read the full stack trace, and the error was that the parameters for a method in the parent class and in the child class wasn’t the same, somehow the IDE just didn’t make any notification.