Particle Systems

Exercise 6.0:

Create a new Particle System from scratch.

It should have 300 particles, which should be rectangles of a random size.

Particles should regenerate when they’ve left the screen.

Particles should start from the bottom left corner of the screen and start off moving towards the top right, with randomization.

First, add a function to regenerate particles when they fall below the bottom of the canvas.

Next, convert to an array of particles. Have the regeneration occur following the mouse instead of at the center of the canvas.

Solution