diff --git a/src/main/java/pacmanGame/Map.java b/src/main/java/pacmanGame/Map.java index 0927b56..4abc105 100644 --- a/src/main/java/pacmanGame/Map.java +++ b/src/main/java/pacmanGame/Map.java @@ -77,6 +77,14 @@ public class Map { } public Cell GetCell(Vector2 pos) { - return cells[pos.x][pos.y]; + if(pos.isWithin(size)) { + + return cells[pos.x][pos.y]; + } + else { + + return cells[0][0]; + } + } }