Basic score count working

update takes movement into account
This commit is contained in:
Urban Modig
2025-08-22 11:00:19 +02:00
parent 9bb76ce682
commit b9a43be3c6
9 changed files with 55 additions and 36 deletions

View File

@ -15,7 +15,7 @@ public class InkyStrategy implements GhostStrategy {
public Point chooseTarget(Ghost ghost, PacMan pacman, GameMap map) {
// 1. Two tiles ahead of pacman
Direction pacmanDir = pacman.getDirection();
Point pacmanPos = pacman.getTilePosition();
Point pacmanPos = pacman.getPosition();
Point ahead = switch (pacmanDir){
case RIGHT -> new Point(pacmanPos.x + 8 * GameMap.MAP_TILESIZE, pacmanPos.y);
case LEFT -> new Point(pacmanPos.x - 8 * GameMap.MAP_TILESIZE, pacmanPos.y);