Browse Source

refactoring: combined both ghost move functions into one

main
fdai7012 11 months ago
parent
commit
3fa12134d0
  1. 7
      src/main/java/pacmanGame/Ghost.java

7
src/main/java/pacmanGame/Ghost.java

@ -17,14 +17,11 @@ public class Ghost {
this.position = newPosition; this.position = newPosition;
} }
public void move(Vector2 direction) {
this.position = this.position.Add(direction);
}
public void spawn() { public void spawn() {
this.position = gameManager.map.ghostSpawns[ghostNumber].Clone(); this.position = gameManager.map.ghostSpawns[ghostNumber].Clone();
} }
public void move() { public void move() {
move(behavior.GetDirection(this));
this.position = this.position.Add(behavior.GetDirection(this));
} }
} }
Loading…
Cancel
Save