A C D G H I K L M P R S T U

A

AirHockey - Class in <Unnamed>
This is the main class for the Air Hockey applet.
AirHockey() - Constructor for class AirHockey
 
autoMove(Dimension, Puck) - Method in class Team
The AI code for the computer team.

C

center(Dimension) - Method in class Team
Centers the paddle
checkCollision() - Method in class AirHockey
Checks for a collision between the strikers and the puck.
checkCollision(Puck) - Method in class Team
Checks for a collision between the strikers and the puck.
checkScore() - Method in class AirHockey
Checks if there has been a score or not
checkScore(Dimension, Puck) - Method in class Team
Checks for a score on the teams goal.
COMPUTER_PLAYER - Static variable in class AirHockey
Position of the computer player paddle.

D

draw(Graphics) - Method in class Puck
Draws the puck on the input graphics
draw(Graphics) - Method in class Team
Draws the paddle on the input screen
drawBackground(Graphics) - Method in class AirHockey
Draws the background for our game.

G

GAMESPEED - Static variable in class AirHockey
The speed at which the game is played.
getColor() - Method in class Team
Returns the color of the team
getPosition() - Method in class Puck
Returns the current position of the puck
getX() - Method in class Puck
Returns the current x coordinate of the puck
getX() - Method in class Team
Returns the current x coordinate of the paddle
getY() - Method in class Puck
Returns the current y coordinate of the puck
getY() - Method in class Team
Returns the current y coordinate of the paddle
GOAL_HEIGHT - Static variable in class AirHockey
The height of the goals
GOAL_WIDTH - Static variable in class AirHockey
Percent of the total width of the goal

H

HUMAN_PLAYER - Static variable in class AirHockey
Position of the human player paddle This value is a percentage of the screen

I

increaseScore() - Method in class Team
Increases the score by one
init() - Method in class AirHockey
The init() method is the entry point for the game.

K

keyPressed(KeyEvent) - Method in class AirHockey
We must use this method because we "implement" KeyListener.
keyReleased(KeyEvent) - Method in class AirHockey
We must use this method because we "implement" KeyListener.
keyTyped(KeyEvent) - Method in class AirHockey
We must use this method because we "implement" KeyListener.

L

LEFT_GOAL - Static variable in class AirHockey
Percent of the left screeen not occupied by the goal

M

move(Dimension) - Method in class Puck
Moves the puck by incrementing the x-position by the x-component of the velocity and incrementing the y-position by the y-component of the velocity
moveLeft(Dimension, int) - Method in class Team
Moves the paddle to the left by the distance specified
moveLeft(Dimension) - Method in class Team
Moves the paddle to the left
moveRight(Dimension, int) - Method in class Team
Moves the paddle to the right by the distance specified
moveRight(Dimension) - Method in class Team
Moves the paddle to the right

P

paint(Graphics) - Method in class AirHockey
Called automatically by our Component (our Applet).
Puck - Class in <Unnamed>
This class represents a puck object.
Puck(Color, int, Dimension) - Constructor for class Puck
Constructor use to initialize variables

R

reset(Dimension) - Method in class Puck
Centers the puck on the board
resetGame() - Method in class AirHockey
This is the code we want to execute when we reset the game.
resize(Dimension, boolean) - Method in class Team
Resizes the goal and moves the paddle to the appropriate locations
reverseX() - Method in class Puck
Reverses the x component of the velocity
reverseY() - Method in class Puck
Reverses the y component of the velocity
run() - Method in class AirHockey
The run() method is called when we create a thread in our applet.

S

setGoal(Dimension, boolean) - Method in class Team
Sets the location of the goal
setPosition(Dimension, int, int) - Method in class Puck
Sets the position of the puck to the coordinates specified
setPosition(Dimension, int, int) - Method in class Team
Sets the position of the paddle to the coordinates specified
setX(Dimension, int) - Method in class Puck
Sets the x coordinate of the puck
setX(Dimension, int) - Method in class Team
Sets the x coordinate of the paddle
setY(Dimension, int) - Method in class Puck
Sets the y coordinate of the puck
setY(Dimension, int) - Method in class Team
Sets the y coordinate of the paddle
stop() - Method in class AirHockey
The stop method is called when the user navigates away from the webpage.

T

Team - Class in <Unnamed>
This class represents a team object.
Team(String, Color, Dimension, Dimension, boolean) - Constructor for class Team
Constructor to initialize the variables
toString() - Method in class Team
Returns a string with the team name and their current score

U

update(Graphics) - Method in class AirHockey
Depending on the value of our switch, we either call our special code, or just call the default code.
updateDoubleBufffered(Graphics) - Method in class AirHockey
Try to do the drawing to an offscreen buffer.

A C D G H I K L M P R S T U