The Lab

Elastic Fireballs

July 6, 2004 · summer after freshman year550 × 400 px · 120 fps · Flash Player 7 · 1.2 KB

Two balls bound together by a distance-based force, each dragging a trail behind it. Twirl them around each other, or throw one and watch the pair roam the screen like a screensaver.

Warming up the Flash emulator…

Drag a ball to twirl the pair around each other — or throw it, let go, and watch. Hold the spacebar to brake.

The story

By the summer of 2004, between freshman and sophomore year, I had already worked out ball momentum, gravity, and bounce physics in earlier Flash experiments. This one started as the next question: what happens if the balls push and pull on each other?

I had spent that school year flunking math class — often not even in the building — but the math showed up anyway the moment I needed it. To make the balls interact I needed the distance between them, so I calculated the hypotenuse from their positions. Then I applied a force to each ball based on that distance, and out came this elastic effect that was ridiculously fun to play with.

The name is a little aspirational. The trail each ball drags behind it is honestly just a line — but I always imagined it as a fire trail, so fireballs they were. You can twirl the balls around each other, or throw one and let the pair wander the screen on their own.

This is the original file, unmodified — all 1.2 KB of it, published for Flash Player 7 — emulated by Ruffle. Download the .swf