Hi I"m receiving this on my program. I know that this happens when i choose a location outside of the map, but how do i fix this?
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at GameMap.getLocation(GameMap.java:56)
return map[xdimension][ydimension];
at Game.startGame(Game.java:87)
System.out.println("New Location:" + mapMgr.getLocation(X,Y).getLocation() + ", "+ mapMgr.getLocation(X,Y).getDescription());
at Game.main(Game.java:168)
g.startGame();