uwcse.sim
Class Firework
java.lang.Object
|
+--uwcse.sim.AbstractParticle
|
+--uwcse.sim.Firework
- All Implemented Interfaces:
- Thing
- Direct Known Subclasses:
- ExplodingFirework, StarFirework, TracerSpot
- class Firework
- extends AbstractParticle
A firework is a simple glowing particle of random color. It is subject
to the law of gravity, so its velocity in the Y direction increases
every turn.
Field Summary |
protected java.awt.Color |
color
|
(package private) static java.awt.Color[] |
colors
|
protected int |
radius
|
Constructor Summary |
Firework(WorldModel wm,
int x,
int y,
int velX,
int velY)
Create a new firework of random color. |
Method Summary |
void |
action()
So super.action(), and increase the Y velocity. |
void |
displayOn(uwcse.graphics.GWindow g)
Display as a circle. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
radius
protected int radius
color
protected java.awt.Color color
colors
static java.awt.Color[] colors
Firework
public Firework(WorldModel wm,
int x,
int y,
int velX,
int velY)
- Create a new firework of random color.
displayOn
public void displayOn(uwcse.graphics.GWindow g)
- Display as a circle.
- Overrides:
displayOn
in class AbstractParticle
action
public void action()
- So super.action(), and increase the Y velocity.
- Overrides:
action
in class AbstractParticle