uwcse.sim
Class ExplodingFirework

java.lang.Object
  |
  +--uwcse.sim.AbstractParticle
        |
        +--uwcse.sim.Firework
              |
              +--uwcse.sim.ExplodingFirework
All Implemented Interfaces:
Thing

class ExplodingFirework
extends Firework

An exploding firework explodes and adds other fireworks to the simulation when its Y velocity reaches zero.


Fields inherited from class uwcse.sim.Firework
color, colors, radius
 
Fields inherited from class uwcse.sim.AbstractParticle
age, rand, velX, velY, world, x, y
 
Constructor Summary
ExplodingFirework(WorldModel wm, int x, int y, int velX, int velY)
          Create a new Exploder.
 
Method Summary
 void action()
          When its Y velocity is zero, new TracerSpots are added.
 boolean isAlive()
          Dies when its Y velocity reaches zero.
 
Methods inherited from class uwcse.sim.Firework
displayOn
 
Methods inherited from class uwcse.sim.AbstractParticle
getX, getY, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExplodingFirework

public ExplodingFirework(WorldModel wm,
                         int x,
                         int y,
                         int velX,
                         int velY)
Create a new Exploder.
Method Detail

action

public void action()
When its Y velocity is zero, new TracerSpots are added.
Overrides:
action in class Firework

isAlive

public boolean isAlive()
Dies when its Y velocity reaches zero.
Overrides:
isAlive in class AbstractParticle