diff --git a/src/Map.java b/src/Map.java index 5bfd1b6..c0a1411 100644 --- a/src/Map.java +++ b/src/Map.java @@ -148,7 +148,7 @@ public class Map for (int i = 0; i < map.length; i++) { - for (int j = 0; j < map.length; j++) + for (int j = 0; j < map[0].length; j++) { switch (map[i][j].getType()) { @@ -207,8 +207,8 @@ public class Map for (int[] pos : coord) { - int x = current.x + pos[0]; - int y = current.y + pos[1]; + int x = current.x + pos[1]; + int y = current.y + pos[0]; if ((x >= 0 && map[0].length > x) && (y >= 0 && map.length > y)) {