Growing Trail Ball
A tiny ball bounces inside a circle, dragging a trail behind it and growing a little
bigger with every bounce off the wall. Once it gets too big, it shatters into voxels
and a fresh, tiny ball takes its place.
Bounces: 0
Size: 0 px
Bursts: 0
Start
Restart
Pause
Sound: On
How it works: the ball bounces elastically off the circular wall,
same reflection formula as the other demos here, and every wall bounce nudges its
radius up by the growth amount. Every single frame — not just on bounce — the ball's
current position and radius are recorded into a trail buffer along with a hue value
that continuously cycles through the color wheel, so the afterimage behind the ball
is a smooth rainbow streak rather than a fixed color: older points are smaller and
more transparent, newer points are bigger and more opaque, and the tail recycles
continuously (oldest points drop off) so it never grows without bound. Once the
ball's radius passes the "max size" threshold, it shatters — the same voxel-burst
effect as 4-Second Escape — and a brand new tiny ball spawns from the center to start
the cycle again. A bigger circle means more bounces (and a longer rainbow streak) per
growth cycle, while a higher growth-per-bounce rate makes it snowball toward the burst
much faster.