Question: Implement a particle system in Processing with the following behavior: A sound effect plays when the mouse is pressed. A number of particles (between 50


Implement a particle system in Processing with the following behavior:

  • A sound effect plays when the mouse is pressed.
  • A number of particles (between 50 and 100) is created at the mouse press location.
  • These particles travel in random directions at random speeds (between 1 and 5).
  • The particles have individual life-spans (between 100 and 200 frames) and are removed when their life-span expired.
  • Particles decelerate with time.
  • Particles have different sizes (diameters between 10 and 30).
  • Particles created at a certain location have all the same hue, but when the mouse is pressed at a different location, they should have a different hue.
  • Each particle is drawn not by using a single ellipse, but as a series of super-imposed ellipses that vary in size. In the example below, 10 ellipses of decreasing sizes are drawn for each particle, while brightness increases the smaller the ellipses get, creating an effect that mimics specks of light. You don't have to replicate this effect, you can make your own: just make sure you use more than 5 ellipses when representing a particle.
  • Recommended canvas size: 800 x 800.
0:08 0:17 1x

CoursHeroTranscribedText

0:08 0:17 1x

Step by Step Solution

3.47 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below is an implementation of a particle system in Processing that meets the specified requirements ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!