|
Ball World Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ballworld.Exploder
A ball that Explodes.
Constructor Summary | |
Exploder()
Create a new exploder with default position. |
|
Exploder(double startx,
double starty,
int generation)
Create an exploder at given coordinates and a predfined generation. |
|
Exploder(World myWorld)
Create a new exploder that is aware of it's world from the start. |
Method Summary | |
void |
act()
|
double |
getRadius()
Returns the current radius of the Ball |
double |
getX()
Returns the current horizontal location of the Ball |
double |
getY()
Returns the current vertical location of the Ball |
void |
setWorld(World theWorld)
This method will be called by our setup code shortly after your Ball is created. |
void |
userClicked(double x,
double y)
Process a click from the mouse. |
void |
userTyped(char key)
This method is called if the user selects this particualr ball and then types a key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Exploder()
public Exploder(World myWorld)
myWorld
- The world that the ball is being created inpublic Exploder(double startx, double starty, int generation)
generation
- Our generationstartx
- Our starting x coordinatestarty
- Our starting y coordinateMethod Detail |
public double getX()
Ball
getX
in interface Ball
public double getY()
Ball
getY
in interface Ball
public double getRadius()
Ball
getRadius
in interface Ball
public void setWorld(World theWorld)
Ball
setWorld
in interface Ball
theWorld
- A world object that contains this ballpublic void userClicked(double x, double y)
Ball
userClicked
in interface Ball
x
- The x coordinate of the user's clicky
- The y coordinate of the user's clickpublic void userTyped(char key)
Ball
userTyped
in interface Ball
key
- The character from the key that the user typed.public void act()
act
in interface Animate
|
Ball World Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |