Implement a particle system in Processing with the following behavior: A sound effect plays when the mouse
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Molecular Cell Biology
ISBN: 978-1429234139
7th edition
Authors: Harvey Lodish, Arnold Berk, Chris A. Kaiser, Monty Krieger, Anthony Bretscher, Hidde Ploegh, Angelika Amon, Matthew P. Scott
Posted Date: