uwcse.sim
Class Canon

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

class Canon
extends AbstractParticle

A Canon is a particle that doesn't move, but adds new fireworks to the simulation every now and then.


Fields inherited from class uwcse.sim.AbstractParticle
age, rand, velX, velY, world, x, y
 
Constructor Summary
Canon(WorldModel wm, int x, int y, int velX, int velY)
          Create a new canon at the given location.
 
Method Summary
 void action()
          Every few turns just adds new Exploding or Star fireworks with random trajectories.
 void displayOn(uwcse.graphics.GWindow g)
          Display as a triangle.
 
Methods inherited from class uwcse.sim.AbstractParticle
getX, getY, isAlive, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Canon

public Canon(WorldModel wm,
             int x,
             int y,
             int velX,
             int velY)
Create a new canon at the given location.
Method Detail

action

public void action()
Every few turns just adds new Exploding or Star fireworks with random trajectories.
Overrides:
action in class AbstractParticle

displayOn

public void displayOn(uwcse.graphics.GWindow g)
Display as a triangle.
Overrides:
displayOn in class AbstractParticle