uwcse.sim
Class TracerSpot

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

class TracerSpot
extends Firework

A tracer spot is a firework that has a tail.


Inner Class Summary
(package private)  class TracerSpot.Point
          Use this private class to represent the tail points.
 
Field Summary
(package private)  java.util.LinkedList tail
           
(package private)  int tailLength
           
 
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
TracerSpot(WorldModel wm, int x, int y, int velX, int velY)
          Create a new tracer.
 
Method Summary
 void action()
          Update my position and then add my new position to my tail list.
 void displayOn(uwcse.graphics.GWindow g)
          Display the firework and its tail.
 boolean isAlive()
          Has a limited lifetime so as not to clog up the simulation.
 
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
 

Field Detail

tail

java.util.LinkedList tail

tailLength

int tailLength
Constructor Detail

TracerSpot

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

displayOn

public void displayOn(uwcse.graphics.GWindow g)
Display the firework and its tail.
Overrides:
displayOn in class Firework

action

public void action()
Update my position and then add my new position to my tail list. Dropping off any points in the tail that are old.
Overrides:
action in class Firework

isAlive

public boolean isAlive()
Has a limited lifetime so as not to clog up the simulation.
Overrides:
isAlive in class AbstractParticle