A B C D E F G H I M O P R S T U V W 
All Classes All Packages

A

addToScore(int) - Method in class Model
update the score
assertTrue(boolean, String, Object...) - Static method in class Debug
Display a fatal message if the assertion fails

B

B - Variable in class Model
First,a collection of useful values for calculating sizes and layouts etc.
ball - Variable in class Model
The game 'model' - these represent the state of the game and are used by the View to display it
ball - Variable in class View
The bat
BALL_MOVE - Variable in class Model
Distance to move bat on each keypress
BALL_SIZE - Variable in class Model
Height of menu bar space at the top
bat - Variable in class Model
 
bat - Variable in class View
 
BAT_MOVE - Variable in class Model
 
BRICK_HEIGHT - Variable in class Model
Brick size
BRICK_WIDTH - Variable in class Model
Ball side
bricks - Variable in class Model
 
bricks - Variable in class View
The ball

C

canvas - Variable in class View
basic layout pane
changeDirectionX() - Method in class GameObj
change direction of movement in x axis (-1, 0 or +1)
changeDirectionY() - Method in class GameObj
change direction of movement in y axis (-1, 0 or +1)
colour - Variable in class GameObj
Height of object
controller - Variable in class Model
 
controller - Variable in class View
The other parts of the model-view-controller setup
Controller - Class in <Unnamed>
 
Controller() - Constructor for class Controller
we don't really need a constructor method, but include one to print a debugging message if required

D

Debug - Class in <Unnamed>
 
Debug() - Constructor for class Debug
 
dirX - Variable in class GameObj
Colour of object
dirY - Variable in class GameObj
Direction X (1, 0 or -1)
displayGameObj(GraphicsContext, GameObj) - Method in class View
Display a game object - it is just a rectangle on the canvas
drawPicture() - Method in class View
drawing the game image

E

error(String, Object...) - Static method in class Debug
Display a fatal message

F

fast - Variable in class Model
Set to "finished" to end the game

G

GameObj - Class in <Unnamed>
 
GameObj(int, int, int, int, Color) - Constructor for class GameObj
Direction Y (1, 0 or -1)
gameState - Variable in class Model
variables that control the game
getBall() - Method in class Model
return ball object
getBat() - Method in class Model
Return bat object
getBricks() - Method in class Model
return bricks
getFast() - Method in class Model
Return game speed - false is normal speed, true is fast
getGameState() - Method in class Model
Return game running state
getScore() - Method in class Model
return score

H

handle(KeyEvent) - Method in class View
Event handler for key presses - it just passes the event to the controller
height - Variable in class GameObj
Width of object
height - Variable in class Model
Width of game
height - Variable in class View
width of window
HIT_BOTTOM - Variable in class Model
Score for hitting a brick
HIT_BRICK - Variable in class Model
Units to move the ball on each step
hitBy(GameObj) - Method in class GameObj
Detect collision between this object and the argument object It's easiest to work out if they do NOT overlap, and then return the opposite

I

infoText - Variable in class View
canvas to draw game on
initialiseGame() - Method in class Model
Initialise the game - reset the score and create the game objects

M

M - Variable in class Model
Border round the edge of the panel
main(String[]) - Static method in class Main
The 'main' method - this is used when launching from the command line.
Main - Class in <Unnamed>
 
Main() - Constructor for class Main
 
model - Variable in class Controller
instance variables for the two other components of the MVC model
model - Variable in class View
 
Model - Class in <Unnamed>
 
Model(int, int) - Constructor for class Model
CONSTRUCTOR - needs to know how big the window will be
modelChanged() - Method in class Model
This is how the Model talks to the View Whenever the Model changes, this method calls the update method in the View.
moveBat(int) - Method in class Model
move the bat one step - -1 is left, +1 is right
moveX(int) - Method in class GameObj
move in x axis
moveY(int) - Method in class GameObj
move in y axis

O

Outline - Variable in class Model
 

P

pane - Variable in class View
user interface objects

R

runGame() - Method in class Model
The main animation loop

S

score - Variable in class Model
 
score - Variable in class View
The bricks
set(boolean) - Static method in class Debug
Set true/false to print debugging information
setFast(Boolean) - Method in class Model
Change game speed - false is normal speed, true is fast
setGameState(String) - Method in class Model
Methods for accessing and updating values these are all synchronized so that the can be called by the main thread or the animation thread safely Change game state - set to "running" or "finished"
start(Stage) - Method in class Main
the 'start' method - this creates the Model, View and Controller objects and // makes them talk to each other, it then sets up the user interface (in the View // object) and starts the game running (in the Model object)
start(Stage) - Method in class View
start is called from the Main class, to start the GUI up
startGame() - Method in class Model
// Animating the game The game is animated by using a 'thread'.

T

topX - Variable in class GameObj
Can be seen on the screen (change to false when the brick gets hit)
topY - Variable in class GameObj
Position - top left corner X
trace(String, Object...) - Static method in class Debug
Display text for debugging purposes

U

update() - Method in class View
This is how the Model talks to the View This method gets called BY THE MODEL, whenever the model changes It has to do whatever is required to update the GUI to show the new game position
updateGame() - Method in class Model
updating the game - this happens about 50 times a second to give the impression of movement
userKeyInteraction(KeyEvent) - Method in class Controller
This is how the View talks to the Controller AND how the Controller talks to the Model This method is called by the View to respond to key presses in the GUI The controller's job is to decide what to do.

V

view - Variable in class Controller
 
view - Variable in class Model
The other parts of the model-view-controller setup
View - Class in <Unnamed>
 
View(int, int) - Constructor for class View
constructor method - we get told the width and height of the window
visible - Variable in class GameObj
state variables for a game object

W

width - Variable in class GameObj
position - top left corner Y
width - Variable in class Model
initialisation parameters for the model
width - Variable in class View
variables for components of the user interface
A B C D E F G H I M O P R S T U V W 
All Classes All Packages