|
class | GameListener |
| action listener for the game page
|
|
class | ModeListener |
| action listener for the game mode page
|
|
class | TutorialListener |
| action listener for the tutorial page
|
|
class | WelcomepageListener |
| action listener for the welcome page
|
|
§ GameController()
Obtain the window frame dimentions
Setups for ball in the Model
Setups for the bomb in the Model
Setups for the paddles in the Model
- obtain paddle dimensions
- initialize paddle positions for the player paddle
- initialize paddle positions for the ai paddle
Setups for the players in the Model
- initialize number of life for the player and the ai
Setups for the View
- obtain windows from the view
- add action listener for different windows
§ checkGameOver()
void startGame.GameController.checkGameOver |
( |
| ) |
|
checks whether the game ends
check the number of life for both the player and the ai is 0.
- If the number of life for the ai is 0, the player wins
- If the number of life for the player is 0, the ai wins.
§ display()
void startGame.GameController.display |
( |
| ) |
|
sets the display
opens a window
§ ADVANCE
final int startGame.GameController.ADVANCE = 1 |
|
private |
§ ai
Player startGame.GameController.ai |
|
private |
Ball startGame.GameController.b |
|
private |
§ ballX
int startGame.GameController.ballX |
|
private |
§ bomb
Ball startGame.GameController.bomb |
|
private |
§ bombX
int startGame.GameController.bombX |
|
private |
§ bottomPadX
int startGame.GameController.bottomPadX |
|
private |
§ frameWidth
int startGame.GameController.frameWidth |
|
private |
§ gameDisplay
§ gameFrame
JFrame startGame.GameController.gameFrame |
|
private |
Variable declarations for the game
- frame dimension
- paddle information
- ball information
- bomb information
- player information
§ gameMode
int startGame.GameController.gameMode |
|
private |
§ inset
int startGame.GameController.inset |
|
private |
§ keys
HashSet<String> startGame.GameController.keys = new HashSet<String>() |
|
private |
Declare a variable for storing the key pressed records
§ mode
Mode startGame.GameController.mode |
|
private |
§ paddle_player
Paddle startGame.GameController.paddle_player |
|
private |
§ padWidth
int startGame.GameController.padWidth |
|
private |
§ player
Player startGame.GameController.player |
|
private |
§ record
Timer startGame.GameController.record |
|
private |
§ scoreTop
int startGame.GameController.scoreTop |
|
private |
§ SINGLE
final int startGame.GameController.SINGLE = 0 |
|
private |
Timer startGame.GameController.t |
|
private |
§ tut
Import model and view to the controller (this interface).
§ velX
int startGame.GameController.velX =1 |
|
private |
Variable declarations for storing the game view windows
- welcome page
- mode page for showing different modes
- tutorial page for giving instructions to the students
The documentation for this class was generated from the following file: