Browse Source

fixed findCellByString funcition in Map

remotes/origin/player
fdai7910 11 months ago
parent
commit
c4d577bfb2
  1. 4
      src/main/java/pacmanGame/Map.java

4
src/main/java/pacmanGame/Map.java

@ -81,12 +81,12 @@ public class Map {
public Cell findCellByString(String target) { public Cell findCellByString(String target) {
for (int x = 0; x < size.x; x++) { for (int x = 0; x < size.x; x++) {
for (int y = 0; y < size.y; y++) { for (int y = 0; y < size.y; y++) {
if (cells[x][y].type == target) {
if (cells[x][y].type.equals(target)) {
return cells[x][y]; return cells[x][y];
} }
} }
} }
System.out.println("couldnt find cell " + target);
return null; return null;
} }
} }
Loading…
Cancel
Save