|
Public Member Functions |
| | GhostActor (GridNode startingPosition, PacmanActor target) |
| | Constructor for this GhostActor.
|
| GridNode | getNode () |
| | Added by Benson Fung (for killing pacman).
|
| void | advanceFrame () |
| | Called to advance the logic of the game one frame.
|
| void | paint (Graphics g) |
| | Paints the GhostActor.
|
| int | getX () |
| | Returns the current x coordinate of the ghost.
|
| int | getY () |
| | Returns the current y coordinate of the ghost.
|
| void | restart () |
Static Public Member Functions |
| void | setRunFromPac (boolean b) |
| | Sets when all ghosts should run from pacman.
|
Static Public Attributes |
| final int | NONE = 0 |
| | Enum for a desired dirrection.
|
| final int | UP = 1 |
| | Enum for a desired dirrection.
|
| final int | DOWN = 2 |
| | Enum for a desired dirrection.
|
| final int | LEFT = 3 |
| | Enum for a desired dirrection.
|
| final int | RIGHT = 4 |
| | Enum for a desired dirrection.
|
Private Member Functions |
| void | moveTowards (int i1, int i2, int i3, int i4) |
| | Tries to move the ghost in these directions.
|
| boolean | goInDirection (int d) |
| | Tries to start moving in the specified dirrection.
|
| boolean | goToNode (GridNode n) |
Private Attributes |
| GridNode | myNode_ |
| | The node where this ghost currently resides.
|
| GridNode | resetNode_ |
| | This is the start node and where the ghost goes back to if pacman is killed.
|
| PacmanActor | target_ |
| | The pacman which this ghost is chasing (or running from).
|
| int | pixelX_ |
| | current X Pixel coord of this actor
|
| int | pixelY_ |
| | current Y Pixel coord of this actor
|
| int | newPixelX_ |
| | destination X Pixel coord for this actor
|
| int | newPixelY_ |
| | destination Y Pixel coord for this actor
|
Static Private Attributes |
| boolean | runFromPac_ |
| | This value is true if the ghosts should run from pacman.
|