|
|
@ -4,12 +4,13 @@ public class Ghost { |
|
|
|
public Vector2 position; |
|
|
|
public final GameManager gameManager; |
|
|
|
public final int ghostNumber; |
|
|
|
|
|
|
|
public GhostBehavior behavior; |
|
|
|
|
|
|
|
public Ghost(GameManager gameManager, int ghostNumber) { |
|
|
|
this.gameManager = gameManager; |
|
|
|
this.ghostNumber = ghostNumber; |
|
|
|
this.position = new Vector2(-1, -1); |
|
|
|
behavior = new GhostBehaviorRandom(); |
|
|
|
} |
|
|
|
|
|
|
|
public void setPosition(Vector2 newPosition) { |
|
|
@ -23,4 +24,7 @@ public class Ghost { |
|
|
|
public void spawn() { |
|
|
|
this.position = gameManager.map.ghostSpawns[ghostNumber].Clone(); |
|
|
|
} |
|
|
|
public void move() { |
|
|
|
move(behavior.GetDirection(this)); |
|
|
|
} |
|
|
|
} |