Main Page   Packages   Alphabetical List   Compound List   File List   Compound Members  

PacmanActor Class Reference

List of all members.

Detailed Description

Represents pacman on the game board.


Public Member Functions

 PacmanActor (GridNode startingPosition)
 Constructor for this PacmanActor.

GridNode getNode ()
int getPelletsEaten ()
int getX ()
int getY ()
int getLivesLeft ()
void setDesiredDirection (int d)
 Sets the dirrection the user wishes pacman to move.

void setLivesLeft (int i)
 Sets the number of lives for this pacman.

boolean isInvincible ()
void restart ()
 Resets Pacman to his original position but keeps the number of pellets eaten.

void advanceFrame ()
 Called to advance the logic of the game one frame.

void paint (Graphics g)
 Paints the PacmanActor.


Public Attributes

int score_
 Keeps track of pacman's current score.

boolean invincible_
 This is the invincibility variable...

int myLivesLeft_
 New April 15th, 2003 Implements Lives.


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 goToNode (GridNode n)

Private Attributes

GridNode myNode_
 The node where pacman currently resides.

int pelletsEaten_
 The number of small pellets that pacman has eaten this game.

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

int direction_
 Desired dirrecton where pacman should move.

int animDirection_ = RIGHT
 NEW Apr.

GridNode startNode_
 The Node where pacman starts.

int mouthAngle_
 The current angle of the opening of pacman's mouth.

int mouthAngleChange_
 The amount and dirrection of change that the mouth will Take in the next frame.

int mouthAngleDirection_
 Specifies startAngle in fillARc depending on direction pacman is facing.

PacmanTimer invincibleTimer
 New April 28th, 2003 Implements Invinciblity.


Constructor & Destructor Documentation

PacmanActor.PacmanActor GridNode  startingPosition  ) 
 

Constructor for this PacmanActor.

Parameters:
startingPosition the GridNode where this ghosts begins the game


Member Function Documentation

void PacmanActor.advanceFrame  ) 
 

Called to advance the logic of the game one frame.

int PacmanActor.getLivesLeft  ) 
 

Returns:
Number of lives pacman has left. If < 0, then game is over

GridNode PacmanActor.getNode  ) 
 

Returns:
the current node where pacman resides

int PacmanActor.getPelletsEaten  ) 
 

Returns:
the number of small pellets that pacman has eaten in this game.

int PacmanActor.getX  ) 
 

Returns:
Pacman's current x coordinate

int PacmanActor.getY  ) 
 

Returns:
Pacman's current y coordinate

void PacmanActor.goToNode GridNode  n  )  [private]
 

Parameters:
n Goes to this node if it is not null

boolean PacmanActor.isInvincible  ) 
 

void PacmanActor.paint Graphics  g  ) 
 

Paints the PacmanActor.

Parameters:
g Graphics object where drawing should take place.

void PacmanActor.restart  ) 
 

Resets Pacman to his original position but keeps the number of pellets eaten.

void PacmanActor.setDesiredDirection int  d  ) 
 

Sets the dirrection the user wishes pacman to move.

Parameters:
d enum: NONE, RIGHT, LEFT, UP, DOWN

void PacmanActor.setLivesLeft int  i  ) 
 

Sets the number of lives for this pacman.

Parameters:
i the number of lives left of pacman you want


Member Data Documentation

int PacmanActor.animDirection_ = RIGHT [private]
 

NEW Apr.

3, 2003 - PDF

  • addresses the problem with pacman moonwalking

Direction PacMan is currently moving

int PacmanActor.direction_ [private]
 

Desired dirrecton where pacman should move.

This is specified by user actions (pressing movment keys)

final int PacmanActor.DOWN = 2 [static]
 

Enum for a desired dirrection.

boolean PacmanActor.invincible_
 

This is the invincibility variable...

If pacman is invincible he'll eat the ghost :o)

PacmanTimer PacmanActor.invincibleTimer [private]
 

New April 28th, 2003 Implements Invinciblity.

final int PacmanActor.LEFT = 3 [static]
 

Enum for a desired dirrection.

int PacmanActor.mouthAngle_ [private]
 

The current angle of the opening of pacman's mouth.

int PacmanActor.mouthAngleChange_ [private]
 

The amount and dirrection of change that the mouth will Take in the next frame.

int PacmanActor.mouthAngleDirection_ [private]
 

Specifies startAngle in fillARc depending on direction pacman is facing.

int PacmanActor.myLivesLeft_
 

New April 15th, 2003 Implements Lives.

GridNode PacmanActor.myNode_ [private]
 

The node where pacman currently resides.

int PacmanActor.newPixelX_ [private]
 

destination X Pixel coord for this actor

int PacmanActor.newPixelY_ [private]
 

destination Y Pixel coord for this actor

final int PacmanActor.NONE = 0 [static]
 

Enum for a desired dirrection.

int PacmanActor.pelletsEaten_ [private]
 

The number of small pellets that pacman has eaten this game.

This helps us calculate the score.

int PacmanActor.pixelX_ [private]
 

current X Pixel coord of this actor

int PacmanActor.pixelY_ [private]
 

current Y Pixel coord of this actor

final int PacmanActor.RIGHT = 4 [static]
 

Enum for a desired dirrection.

int PacmanActor.score_
 

Keeps track of pacman's current score.

GridNode PacmanActor.startNode_ [private]
 

The Node where pacman starts.

final int PacmanActor.UP = 1 [static]
 

Enum for a desired dirrection.


The documentation for this class was generated from the following file:
Generated on Tue May 13 00:53:03 2003 for PACMAN by doxygen1.3