Instructions
This app is just a slight modification of the 'Momentum Madness' app.
When the page loads you see a 'Molecool' bouncing off the walls. If you click in the canvas, the sketch will pause; another click will add another 'Molecool' at the click location, but it will be 'dormant' and will be shown with a muted color.
Once a dormant 'Molecool' is hit, it will brighten and become active, adding to the action.
Continue adding 'Molecools' to see what happens. You can refresh the page to start over.
Look at the source code to see how classes for the Grid and the Molecools were created in JavaScript.
Because we did not refresh the background with each call of Processing's 'draw' function, the 'Molecools' leave trails. We also turned off the distracting directional line.
If you examine the 'sketch' source code, we showed the places (via comments) where changes to the 'madness' code were made to give us the 'comet' code. Only a small handful of changes were necessary.
Last update: 10/16/19