Added debug variable
This commit is contained in:
parent
0bfc621ade
commit
6873572994
3 changed files with 29 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import java.util.Random;
|
||||
|
||||
import ei.engine.math.Vector2i;
|
||||
import ei.engine.util.MultiPrintStream;
|
||||
import ei.game.gamestate.InGameState;
|
||||
|
||||
public class AStar{
|
||||
|
|
@ -41,8 +42,21 @@ public class AStar{
|
|||
System.out.println("Initializing map");
|
||||
// Create the map.
|
||||
map = new AStarNode2D[width][hight];
|
||||
for(int y = 0, nodeId = 0; hight > y; y++) {
|
||||
MultiPrintStream.out.println();
|
||||
for(int x = 0; width > x; x++, nodeId++) {
|
||||
map[x][y] = new AStarNode2D(x, y, nodeId);
|
||||
|
||||
if(!InGameState.getMap().isPosEmpty(x, y)) {
|
||||
map[x][y].setBlocked(true);
|
||||
MultiPrintStream.out.print(1);
|
||||
}
|
||||
else MultiPrintStream.out.print(0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
for(int x = 0, nodeId = 0; width > x; x++) {
|
||||
|
||||
for(int y = 0; hight > y; y++, nodeId++) {
|
||||
map[x][y] = new AStarNode2D(x, y, nodeId);
|
||||
|
||||
|
|
@ -51,6 +65,7 @@ public class AStar{
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Create the neighbours.
|
||||
for(int x = 0; width > x; x++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue