public class Pant
extends java.lang.Object
Constructor and Description |
---|
Pant(float x,
float y,
java.util.Random randGen)
This constructor initializes a new instance of Pant at the appropriate
location.
|
Modifier and Type | Method and Description |
---|---|
Graphic |
getGraphic()
This is a simple accessor for this object's Graphic, which may be used
by other objects to check for collisions.
|
Fire |
handleFireballCollisions(java.util.ArrayList fireballs)
This method detects an handles collisions between any active Fireball,
and the current Pant.
|
boolean |
shouldRemove()
This method communicates to the Game whether this Pant is still in use
versus ready to be removed from the Game's ArrayList of Pants.
|
void |
update(int time)
This method is simply responsible for draing the current Pant to the
screen.
|
public Pant(float x, float y, java.util.Random randGen)
x
- the x-coordinate of this new Pant's positiony
- the y-coordinate of this new Pant's positionrandGen
- a Random number generator to pass onto any Fire that is
created as a result of this Pant being hit by a Fireball.public void update(int time)
time
- is the amount of time in milliseconds that has elapsed since
the last time this update was called.public Graphic getGraphic()
public Fire handleFireballCollisions(java.util.ArrayList fireballs)
fireballs
- the ArrayList of Fireballs that should be checked
against the current Pant object's Graphic for collisions.public boolean shouldRemove()