|
@ -5,49 +5,30 @@ import java.util.HashMap; |
|
|
public class Map { |
|
|
public class Map { |
|
|
|
|
|
|
|
|
public final GameManager gameManager; |
|
|
public final GameManager gameManager; |
|
|
public static String[] mapClassic = { |
|
|
|
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", |
|
|
|
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", |
|
|
|
|
|
"ww............ww............ww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", |
|
|
|
|
|
"wwpwwww.wwwww.ww.wwwww.wwwwpww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", |
|
|
|
|
|
"ww..........................ww", |
|
|
|
|
|
"ww.wwww.ww.wwwwwwww.ww.wwww.ww", |
|
|
|
|
|
"ww.wwww.ww.wwwwwwww.ww.wwww.ww", |
|
|
|
|
|
"ww......ww....ww....ww......ww", |
|
|
|
|
|
"wwwwwww.wwwwwewwewwwww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwwwwewwewwwww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
|
|
|
"eeeeeee.eeeweeeeeeweee.eeeeeee", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
|
|
|
"ww............ww............ww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", |
|
|
|
|
|
"wwp..ww.......s........ww..pww", |
|
|
|
|
|
"wwww.ww.ww.wwwwwwww.ww.ww.wwww", |
|
|
|
|
|
"wwww.ww.ww.wwwwwwww.ww.ww.wwww", |
|
|
|
|
|
"ww......ww....ww....ww......ww", |
|
|
|
|
|
"ww.wwwwwwwwww.ww.wwwwwwwwww.ww", |
|
|
|
|
|
"ww.wwwwwwwwww.ww.wwwwwwwwww.ww", |
|
|
|
|
|
"ww..........................ww", |
|
|
|
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", |
|
|
|
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public final HashMap<String, String> mapTypes = new HashMap<String,String>(){{ |
|
|
|
|
|
|
|
|
public static String[] mapClassic = { "wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", |
|
|
|
|
|
"ww............ww............ww", "ww.wwww.wwwww.ww.wwwww.wwww.ww", "wwpwwww.wwwww.ww.wwwww.wwwwpww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", "ww..........................ww", "ww.wwww.ww.wwwwwwww.ww.wwww.ww", |
|
|
|
|
|
"ww.wwww.ww.wwwwwwww.ww.wwww.ww", "ww......ww....ww....ww......ww", "wwwwwww.wwwwwewwewwwww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwwwwewwewwwww.wwwwwww", "wwwwwww.wweeeeeeeeeeww.wwwwwww", "wwwwwww.wwewwwwwwwweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", "Teeeeee.eeeweeeeeeweee.eeeeeet", "wwwwwww.wweweeeeeeweww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wweweeeeeeweww.wwwwwww", "wwwwwww.wwewwwwwwwweww.wwwwwww", "wwwwwww.wweeeeeeeeeeww.wwwwwww", |
|
|
|
|
|
"wwwwwww.wwewwwwwwwweww.wwwwwww", "ww............ww............ww", "ww.wwww.wwwww.ww.wwwww.wwww.ww", |
|
|
|
|
|
"ww.wwww.wwwww.ww.wwwww.wwww.ww", "wwp..ww.......s........ww..pww", "wwww.ww.ww.wwwwwwww.ww.ww.wwww", |
|
|
|
|
|
"wwww.ww.ww.wwwwwwww.ww.ww.wwww", "ww......ww....ww....ww......ww", "ww.wwwwwwwwww.ww.wwwwwwwwww.ww", |
|
|
|
|
|
"ww.wwwwwwwwww.ww.wwwwwwwwww.ww", "ww..........................ww", "wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", |
|
|
|
|
|
"wwwwwwwwwwwwwwwwwwwwwwwwwwwwww" }; |
|
|
|
|
|
|
|
|
|
|
|
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"); |
|
|
this.put("p", "pill"); |
|
|
this.put("p", "pill"); |
|
|
}}; |
|
|
|
|
|
|
|
|
this.put("T", "tpLeft"); |
|
|
|
|
|
this.put("t", "tpRight"); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
public Cell[][] cells; |
|
|
public Cell[][] cells; |
|
|
public Vector2 size; |
|
|
public Vector2 size; |
|
@ -90,11 +71,22 @@ public class Map { |
|
|
if (pos.isWithin(size)) { |
|
|
if (pos.isWithin(size)) { |
|
|
|
|
|
|
|
|
return cells[pos.x][pos.y]; |
|
|
return cells[pos.x][pos.y]; |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
return cells[0][0]; |
|
|
return cells[0][0]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Cell findCellByString(String target) { |
|
|
|
|
|
for (int x = 0; x < size.x; x++) { |
|
|
|
|
|
for (int y = 0; y < size.y; y++) { |
|
|
|
|
|
if (cells[x][y].type == target) { |
|
|
|
|
|
return cells[x][y]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |