Fixing minor issues

This commit is contained in:
Urban Modig
2025-08-20 16:33:18 +02:00
parent 8e546fe942
commit d06e7131ad
3 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,7 @@ public class CollisionChecker {
int x = pos.x; int x = pos.x;
int y = pos.y; int y = pos.y;
int width = GamePanel.SCREEN_WIDTH; int width = GamePanel.SCREEN_WIDTH;
int height = map.getHeight(); int height = GamePanel.SCREEN_HEIGHT;
// tunnel // tunnel
if (x < GameMap.OFFSET_X) x = width - agent_width/2 - GameMap.OFFSET_X; // right if (x < GameMap.OFFSET_X) x = width - agent_width/2 - GameMap.OFFSET_X; // right

View File

@ -15,7 +15,7 @@ public class ClydeStrategy implements GhostStrategy {
if (distance > 8) { if (distance > 8) {
return pacTile; // chase Pac-Man return pacTile; // chase Pac-Man
} else { } else {
return new Point(0, map.getHeight() - 1); // retreat to corner return new Point(0, GameMap.OFFSET_Y + (map.rows() * GameMap.MAP_TILESIZE)); // retreat to corner
} }
} }
} }

View File

@ -200,4 +200,5 @@ public class GameMap {
public int rows() { public int rows() {
return mapData.length; return mapData.length;
} }
} }