public class Fireball
extends java.lang.Object
Constructor and Description |
---|
Fireball(float x,
float y,
float directionAngle)
This constructor initializes a new instance of Fireball at the specified
location and facing a specific movement direction.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
This helper method allows other classes (like Pant) to destroy a Fireball
upon collision.
|
Graphic |
getGraphic()
This is a simple accessor for this object's Graphic, which may be used
by other objects to check for collisions.
|
void |
handleWaterCollisions(Water[] water)
This method detects and handles collisions between any active (!= null)
Water objects, and the current Fireball.
|
boolean |
shouldRemove()
This method communicates to the Level whether this Fireball is still in
use versus ready to be removed from the Levels's ArrayList of Fireballs.
|
void |
update(int time)
This method is called repeatedly by the Level to draw and move the
current Fireball.
|
public Fireball(float x, float y, float directionAngle)
x
- the x-coordinate of this new Fireball's positiony
- the y-coordinate of this new Fireball's positiondirectionAngle
- the angle (in radians) from 0 to 2pi that this
new Fireball should be both oriented and moving according to.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 void handleWaterCollisions(Water[] water)
water
- is the Array of Water objects that have been launched by
the Hero (ignore any null references within this array).public void destroy()
public boolean shouldRemove()