It contains the main functionality of the game. It does three things basically
Public Member Functions | |
| GameCanvas (pacman midlet, int level, int score, int lives) | |
| Constructor. | |
| void | unPause () |
| void | advanceFrame () |
| This function is called periodically by FrameTrigger. | |
| void | commandAction (Command c, Displayable s) |
| Respond to a command issued on the canvas. | |
Public Attributes | |
| GameBoard | gameBoard_ |
| The game board contains the game primitives, logic, and drawing code. | |
| FrameTrigger | frameTrigger_ |
| frameTrigger object is responsible for periodically calling back to this object to trigger a frame update. | |
Protected Member Functions | |
| void | paint (Graphics g) |
| Called by the system to repaint the screen. | |
| void | keyPressed (int keyCode) |
| This function is called by the system when the user presses a key. | |
Private Attributes | |
| final pacman | midlet |
| final Command | exitCommand |
| final Command | menuCommand |
| final int | level |
|
||||||||||||||||||||
|
Constructor.
|
|
|
This function is called periodically by FrameTrigger. It simply tells the gameboard to advance it's logic by one frame, then it requests a repaint from the system. |
|
||||||||||||
|
Respond to a command issued on the canvas.
|
|
|
This function is called by the system when the user presses a key.
|
|
|
Called by the system to repaint the screen.
|
|
|
|
|
|
|
|
|
frameTrigger object is responsible for periodically calling back to this object to trigger a frame update.
|
|
|
The game board contains the game primitives, logic, and drawing code. This object is created during construction. |
|
|
|
|
|
|
|
|
|
1.3