public class Fire
extends java.lang.Object
Constructor and Description |
---|
Fire(float x,
float y,
java.util.Random randGen)
This constructor initializes a new instance of Fire at the appropriate
location and with the appropriate amount of heat.
|
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.
|
void |
handleWaterCollisions(Water[] water)
This method detects and handles collisions between any active (!= null)
Water objects, and the current Fire.
|
boolean |
shouldRemove()
This method should return false until this Fire's heat drops down to 0 or
less.
|
Fireball |
update(int time)
This method is called repeatedly by the Level to draw and occasionally
launch a new Fireball in a random direction.
|
public Fire(float x, float y, java.util.Random randGen)
x
- the x-coordinate of this new Fire's positiony
- the y-coordinate of this new Fire's positionrandGen
- a Random number generator to determine when and in which
direction new Fireballs are created and launched.public Fireball 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 boolean shouldRemove()