Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
A
C
D
E
F
G
H
I
M
O
P
R
S
T
U
V
X
Y
A
addScore()
- Method in class
Player
Increment the score of this Player by 1.
addScore(int)
- Method in class
Player
Increment the score of this Player by the given addition value.
applyForce(double, double)
- Method in class
Marble
Apply a force to this marble (causing it to move).
C
changeTurn()
- Method in class
MarbleGameCanvas
Check if a player's turn has been changed.
clearMarks()
- Method in class
MarbleGameCanvas
Clear the marks on this canvas.
color
- Variable in class
Marble
The color of the marble.
createImage(int, int)
- Method in interface
DoubleBufferedComponent
Create an Image given the width and height.
D
direction
- Variable in class
VectorQuantity
The direction of the vector (in radians),
direction(double, double, double, double)
- Static method in class
MotionUtils
Performs the same function as
direction(Point, Point)
but the arguments are integer coordinates.
direction(HiResPoint, HiResPoint)
- Static method in class
MotionUtils
Return the direction between the given pair of HiResPoints
direction(Point, Point)
- Static method in class
MotionUtils
Return the direction from point a to point b.
distance(double, double, double, double)
- Static method in class
MotionUtils
Return the distance between the given pair of coordinates.
distance(HiResPoint, HiResPoint)
- Static method in class
MotionUtils
Return the distance between the given pair of HiRes points.
distance(Point, Point)
- Static method in class
MotionUtils
Return the distance between the given pair of points.
DoubleBufferedComponent
- interface
DoubleBufferedComponent
.
DoubleBufferedComponent is an interface for defining a double-buffered component.
DoubleBufferHandler
- class
DoubleBufferHandler
.
DoubleBufferHandler is a delegation-based double-buffering handler.
DoubleBufferHandler(DoubleBufferedComponent)
- Constructor for class
DoubleBufferHandler
Construct a new DoubleBufferHandler.
draw(Graphics)
- Method in class
Marble
Ask this marble to draw itself on the given Graphics object.
draw(Graphics)
- Method in class
OtherMarble
Draw this OtherMarble on the given Graphics object.
draw(Graphics)
- Method in class
ShooterMarble
Draw this ShooterMarble on the given Graphics object.
E
equals(HiResPoint)
- Method in class
HiResPoint
Test to see if the given point has the same x and y coordinates as this one
F
FRICTION
- Static variable in class
Marble
A change to velocity; applied each time the marble moves.
G
getBorderWidth()
- Method in class
MarbleGameCanvas
Get the width of the border.
getColor()
- Method in class
Marble
Get the color of this marble.
getDirection()
- Method in class
Marble
Get this marble's direction of travel (in radians).
getPathEnumerator()
- Method in class
Marble
Return an object that will enumerate the Points through which this marble will pass during its next move.
getPlayerID()
- Method in class
Player
Get the ID of this Player.
getScore()
- Method in class
Player
Get the current score of this Player.
getSize()
- Method in interface
DoubleBufferedComponent
Get the size of this Component object.
getVelocity()
- Method in class
Marble
Get this marble's current velocity (the number of pixels it moves between redraws).
getVertex()
- Method in class
Marble
Get the location (in Point) of this marble.
H
HiResPoint
- class
HiResPoint
.
A HiResPoint is like a simplified version of java.awt.Point, but it maintains its coordinates as doubles instead of integers.
HiResPoint()
- Constructor for class
HiResPoint
Construct a new point whose coorinates are (0.0, 0.0)
HiResPoint(double, double)
- Constructor for class
HiResPoint
Construct a new point with the specified set of coordinates
HiResPoint(HiResPoint)
- Constructor for class
HiResPoint
Construct a new HiResPoint from an existing one.
HiResPoint(Point)
- Constructor for class
HiResPoint
Construct a new HiResPoint from the given java.awt.point
I
init()
- Method in class
MarbleGame
Initialize this MarbleGame applet.
initCanvas(Player, Player, Image)
- Method in class
MarbleGameCanvas
Initialize this canvas.
isGameOver()
- Method in class
MarbleGameCanvas
Check if the game is over.
isLag
- Static variable in class
MarbleGame
The flag to determine whether the game is currently in the Laggin session.
isMoving()
- Method in class
Marble
Check if this marble is moving.
isOutsideRing()
- Method in class
Marble
Check if this marble is outside the boundary of the ring.
isTouching(Marble)
- Method in class
Marble
Check if this marble is touching the other marble.
isTouching(Point)
- Method in class
Marble
Check if this marble is touching the given point.
isTouching(Point, double)
- Method in class
Marble
Check if this marble is within the distance
distance
of the given point.
isTurn()
- Method in class
Player
Check if it is this Player's turn in the game.
M
magnitude
- Variable in class
VectorQuantity
The magnitude of the vector.
Marble
- class
Marble
.
The abstract class for the Marble object.
Marble(Color, int, int, int)
- Constructor for class
Marble
Construct a new marble with the specified color, ringCenterX, ringCenterY, and ringRadius.
MarbleGame
- class
MarbleGame
.
MarbleGame is a 2-player version of the conventional game of shooting marbles.
MarbleGame.TableListener
- class
MarbleGame.TableListener
.
TableListener is a MouseEventListener that listens for clicks on the surface of the marble game canvas.
MarbleGame.TableListener(MarbleGame)
- Constructor for class
MarbleGame.TableListener
MarbleGame()
- Constructor for class
MarbleGame
Construct this MarbleGame applet.
MarbleGameCanvas
- class
MarbleGameCanvas
.
MarbleGameCanvas is the canvas object which all the drawings and animations of the marble game takes place.
MarbleGameCanvas()
- Constructor for class
MarbleGameCanvas
MotionUtils
- class
MotionUtils
.
MotionUtils is a class with a number of static methods for findings distances and direction.
MotionUtils()
- Constructor for class
MotionUtils
mouseClicked(MouseEvent)
- Method in class
MarbleGame.TableListener
move()
- Method in class
Marble
Move this marble, by having it recompute its coordinate, adjusting speed and velocity as necessary.
move(double, double)
- Static method in class
MotionUtils
Given a magnitude and a direction, return a Point whose x and y members are the deltas that would result from moving a distance of
magnitude
in the given
direction
.
O
oppositeDirection(double)
- Static method in class
MotionUtils
Given a direction, return the opposite direction (eg - PI radians the other way).
OtherMarble
- class
OtherMarble
.
OtherMarble is a concrete Marble with its role as the marble other than the ShooterMarble in the marble game.
OtherMarble(Color, int, int, int)
- Constructor for class
OtherMarble
Construct an OtherMarble.
P
paint(Graphics)
- Method in class
MarbleGameCanvas
Draw objects on the given Graphics.
paintFrame(Graphics)
- Method in interface
DoubleBufferedComponent
Update the animation frame on the given Graphics object.
paintFrame(Graphics)
- Method in class
MarbleGameCanvas
Update drawing/animation frame on the given Graphics object.
Player
- class
Player
.
Player is the class that represents the player of the marble game.
Player(int)
- Constructor for class
Player
Construct a Player.
player0Marble
- Variable in class
MarbleGameCanvas
The player 1's shooter.
player1Marble
- Variable in class
MarbleGameCanvas
The player 2's shooter.
playerID
- Static variable in class
MarbleGame
The ID of the player currently in turn.
pointValue()
- Method in class
HiResPoint
Create a new java.awt.Point from this HiResPoint, where the coordinate of the awt point are the rounded coordinates of this point
R
radiansToDegrees(double)
- Static method in class
MotionUtils
Convert radians to degrees.
RADIUS
- Static variable in class
Marble
Radius for each Marble is a fixed 6 pixels.
resetCanvas()
- Method in class
MarbleGameCanvas
Reset this canvas to the game start state.
resetLagCanvas()
- Method in class
MarbleGameCanvas
Reset this canvas to the Lagging session state.
resultant(double, double, double, double)
- Static method in class
MotionUtils
Given two magnitudes and two direction, return their resultant.
S
setChangeTurn(boolean)
- Method in class
MarbleGameCanvas
Set the changeTurn flag.
setMark(int, int)
- Method in class
MarbleGameCanvas
Ask this canvas to set a marker at the given coordinates.
setScore(int)
- Method in class
Player
Set the score of this Player to the given score.
setTurn(boolean)
- Method in class
Player
Set the the turn flag for this player.
setVertex(double, double)
- Method in class
Marble
Set the location of this marble, after rounding x and y to integers.
setVertex(int, int)
- Method in class
Marble
Set the location of this marble.
ShooterMarble
- class
ShooterMarble
.
ShooterMarble is a concrete Marble with its role as the shooter in the marble game.
ShooterMarble(Color, int, int, int)
- Constructor for class
ShooterMarble
Construct a ShooterMarble.
shootMarble(int)
- Method in class
MarbleGameCanvas
Shoot the marble.
shootShooterMarble(int)
- Method in class
MarbleGameCanvas
For handling lag shots
T
TERMINAL_VELOCITY
- Static variable in class
Marble
The fastest that the marble is allowed to move (in pixels/move).
toString()
- Method in class
HiResPoint
Return a string representation of this HiResPoint.
toString()
- Method in class
Marble
Get the string representation of this marble.
toString()
- Method in class
VectorQuantity
Return an informative string representation of this VectorQuantity object.
U
update(Graphics)
- Method in class
DoubleBufferHandler
Update the animation frame on the given Graphics object
update(Graphics)
- Method in class
MarbleGameCanvas
Update the drawing of the objects on the given Graphics for double-buffering.
V
VectorQuantity
- class
VectorQuantity
.
VectoryQuantity is a "struct class" -- a simple container that represents the components of a vector: magnitude and direction.
VectorQuantity()
- Constructor for class
VectorQuantity
Construct a new VectorQuantity with magnitude and direction of zero.
VectorQuantity(double, double)
- Constructor for class
VectorQuantity
Construct a new VectorQuantity object with the specified magnitude and direction.
X
x
- Variable in class
HiResPoint
The x coorinate of this point
x
- Variable in class
Marble
The x coordinate of the vertex of the marble.
Y
y
- Variable in class
HiResPoint
The y coordinate of this point
y
- Variable in class
Marble
The y coordinate of the vertex of the marble.
A
C
D
E
F
G
H
I
M
O
P
R
S
T
U
V
X
Y
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES