Assignment

Goal

I want to create a sparkler effect using a particle system. I started modifying a fireworks example from The Coding Train: Fireworks Challenge

image.png

What I Changed

In the original example, fireworks shoot up and explode after some time. For a sparkler, the sparks should appear immediately, so I made the explosion happen right when the particle is created.

Looking at sparkler photos, I noticed that sparks look like streaks rather than dots. So instead of relying on the background not refreshing to create trails, I used a different method:

Here’s the sketch:

https://editor.p5js.org/shunhuang0906/full/L-PZ3FqDp

Next Steps

From the reference photos, each streak has a bright mini explosion at its tip. To implement this, I plan to introduce secondary particles that spawn at the endpoint of the main spark’s trail. These tiny sparks will likely follow a similar particle system but with shorter lifespan and more random motion.

On class

p5.Sound

%

is useful for make counter that go back to 0 for fixed amount

todo:

have meditative sound wave using fft

responsive canvas: https://codingtrain.github.io/12oclocks/#clock-09