|
@ -21,8 +21,8 @@ public class Map { |
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
"eeeeeee.eeeweeeeeeweee.eeeeeee", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
|
|
|
|
|
|
"eeeeeee.eeewe0ee2eweee.eeeeeee", |
|
|
|
|
|
"wwwwwww.wwewe1ee3eweww.wwwwwww", |
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
@ -41,13 +41,22 @@ public class Map { |
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww" |
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww" |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public Vector2[] ghostSpawns; |
|
|
|
|
|
public String ghostSpawnChars = "0123456789"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final HashMap<String, String> mapTypes = new HashMap<String,String>(){{ |
|
|
public final HashMap<String, String> mapTypes = new HashMap<String,String>(){{ |
|
|
this.put("e", "empty"); |
|
|
this.put("e", "empty"); |
|
|
this.put("s", "empty"); |
|
|
this.put("s", "empty"); |
|
|
this.put(".", "dot"); |
|
|
this.put(".", "dot"); |
|
|
this.put("w", "wall"); |
|
|
this.put("w", "wall"); |
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < 10; i++) { |
|
|
|
|
|
this.put(i+"", "empty"); |
|
|
|
|
|
} |
|
|
}}; |
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Cell[][] cells; |
|
|
public Cell[][] cells; |
|
|
public Vector2 size; |
|
|
public Vector2 size; |
|
|
|
|
|
|
|
@ -78,6 +87,8 @@ public class Map { |
|
|
|
|
|
|
|
|
cells[x][y] = new Cell(cellPos, cellType, this); |
|
|
cells[x][y] = new Cell(cellPos, cellType, this); |
|
|
|
|
|
|
|
|
|
|
|
//for(int i = 0; i < gameManager.ghosts.length; i++) |
|
|
|
|
|
|
|
|
if(cellChar == playerSpawnChar) { |
|
|
if(cellChar == playerSpawnChar) { |
|
|
playerSpawn = cellPos.Clone(); |
|
|
playerSpawn = cellPos.Clone(); |
|
|
} |
|
|
} |
|
@ -96,4 +107,25 @@ public class Map { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
private void initializeGhostSpawns() { |
|
|
|
|
|
int count = 0; |
|
|
|
|
|
for (int y = 0; y < mapClassic.length; y++) { |
|
|
|
|
|
for (int x = 0; x < mapClassic[y].length(); x++) { |
|
|
|
|
|
char cellChar = mapClassic[y].charAt(x); |
|
|
|
|
|
if (ghostSpawnChars.indexOf(cellChar) != -1) { |
|
|
|
|
|
count++; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
ghostSpawns = new Vector2[count]; |
|
|
|
|
|
count = 0; |
|
|
|
|
|
for (int y = 0; y < mapClassic.length; y++) { |
|
|
|
|
|
for (int x = 0; x < mapClassic[y].length(); x++) { |
|
|
|
|
|
char cellChar = mapClassic[y].charAt(x); |
|
|
|
|
|
if (ghostSpawnChars.indexOf(cellChar) != -1) { |
|
|
|
|
|
ghostSpawns[count++] = new Vector2(x, mapClassic.length - 1 - y); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |