From b35900527177c7e62cd318badc34f875e6536588 Mon Sep 17 00:00:00 2001 From: fdai7753 Date: Wed, 7 Feb 2024 17:29:21 +0100 Subject: [PATCH] refactoring: Fixed ghosts changing own spawn while moving --- src/main/java/pacmanGame/Ghost.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/pacmanGame/Ghost.java b/src/main/java/pacmanGame/Ghost.java index 40bc53d..a7acce0 100644 --- a/src/main/java/pacmanGame/Ghost.java +++ b/src/main/java/pacmanGame/Ghost.java @@ -21,6 +21,6 @@ public class Ghost { } public void spawn() { - this.position = gameManager.map.ghostSpawns[ghostNumber]; + this.position = gameManager.map.ghostSpawns[ghostNumber].Clone(); } }