Project 4.3: Fireworks Extended
Make different types of fireworks with each click

REQUIREMENTS

Create three Particle subclasses with unique behavior

Suggested Particle Traits

(1) Appearance

(2) Motion

(3) Special Effect

Examples

STEP BY STEP

1) Create a Basic Particle Subclass

Example:

class GreenSparkly extends Particle

{

   GreenSparkly()

   {

      super(); 

   } 

}


2) Update  Your Click Event

Example:

void mousePressed()

{

   if(mouseButton == LEFT)

   {

      for(int i = 0 ; i < 30; i++)

      {

         particles.add(new GreenSparkly()); 

      }

   }

}

At this stage when you run the program, it will still look like basic particles.  Test that it runs okay, and we'll change that soon!

3) Make Your Particle Unique


class GreenSparkly extends Particle

{

   GreenSparkly()

   {

      super(); 

      r = 0;

      b = 0;

   }

   void update()

   {

      super.update();

      g = (int) random(100, 255);

   }

}


You should see green shimmering particles now.  What else can you do to make this firework unique?

4) Add Sufficient Details To Meet Requirement

5) Add Particle #2 and #3

EXTRA CREDIT

Students can earn up to 10% extra credit by making especially complex and impressive fireworks.  

EXAMPLE: RUNNING PROGRAM

Click here to download a running version of the program.   <COMING SOON>