diff --git a/src/main/java/pacmanGame/Cell.java b/src/main/java/pacmanGame/Cell.java index f01761e..46c71f2 100644 --- a/src/main/java/pacmanGame/Cell.java +++ b/src/main/java/pacmanGame/Cell.java @@ -3,10 +3,12 @@ package pacmanGame; public class Cell { public Vector2 pos; public String type; + public final Map map; - public Cell(Vector2 pos, String type) { + public Cell(Vector2 pos, String type, Map map) { this.pos = pos; this.type = type; + this.map = map; } public void triggerDot() { diff --git a/src/main/java/pacmanGame/Map.java b/src/main/java/pacmanGame/Map.java index ce72d36..40ab6aa 100644 --- a/src/main/java/pacmanGame/Map.java +++ b/src/main/java/pacmanGame/Map.java @@ -76,7 +76,7 @@ public class Map { String cellType = mapTypes.get(String.valueOf(cellChar)); - cells[x][y] = new Cell(cellPos, cellType); + cells[x][y] = new Cell(cellPos, cellType, this); if(cellChar == playerSpawnChar) { playerSpawn = cellPos.Clone();