§ GameModel()
model.GameModel.GameModel |
( |
| ) |
|
Constructor for the game Model.
Contains all the data and models for the game, including the player, paddle, and the ball.
Declara variables/instances for the model
- regular ball
- bomb
- paddle for the player
- paddle for the computer
- score and life for the player
- score and life for the ai
§ getBall()
Ball model.GameModel.getBall |
( |
| ) |
|
gets the Ball object
- Returns
- b is the ball object
§ getBomb()
Ball model.GameModel.getBomb |
( |
| ) |
|
gets the bomb object
- Returns
- bomb is the bomb object
§ getComputer()
Player model.GameModel.getComputer |
( |
| ) |
|
gets the computer object
- Returns
- computer
§ getComputerPaddle()
Paddle model.GameModel.getComputerPaddle |
( |
| ) |
|
gets the computer paddle object
- Returns
- p_computer
§ getPlayer()
Player model.GameModel.getPlayer |
( |
| ) |
|
gets the player object
- Returns
- player
§ getPlayerPaddle()
Paddle model.GameModel.getPlayerPaddle |
( |
| ) |
|
gets the user paddle object
- Returns
- p_player
§ setBall()
void model.GameModel.setBall |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
sets the x and y positions of a ball
- Parameters
-
x | is the x position of the ball |
y | is the y position of the ball |
- Exceptions
-
ArithmeticException | ball position could not be set out of the game frame. |
§ setBomb()
void model.GameModel.setBomb |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
sets the x and y positions of a bomb
- Parameters
-
x | is the x position of the bomb |
y | is the y position of the bomb |
The ball object for the game
§ p_player
Paddle model.GameModel.p_player |
|
private |
The two paddle in the game, one for the player and the other for the computer
§ player
The two players in the game, one for the user and the other for the computer
The documentation for this class was generated from the following file: