Building a CLI Firework Simulation in Python, Just for Fun


Every now and then it is worth building something with no real business value at all.

JordiCorbilla/firework-simulation: firework-simulation

This terminal firework simulation was one of those projects.


It was not meant to be a serious graphics engine, a physics experiment, or a polished game. It was just a fun idea: could a terminal window, a handful of ASCII characters, and some ANSI colors feel enough like fireworks to make me smile? The answer turned out to be yes.

The basic idea is simple. A rocket launches from the bottom of the terminal, rises with velocity and gravity, bursts near its apex, and then scatters particles across the screen. Those particles fade out over time, slow down slightly, and disappear. Render that fast enough in a loop and you get something that feels lively, colourful, and surprisingly expressive for such a low-tech medium.

What makes a project like this enjoyable is that the constraints are part of the charm. A terminal is a terrible place for realistic animation. Resolution is coarse, circles are approximate, motion is chunky, and different terminals behave differently. But that is exactly why the project works best as a stylized effect rather than a realistic one. Bright colours, simple trails, exaggerated bursts, and particles fading from @ to o to * to . do more for the effect than realism ever could.

The implementation uses plain Python and ANSI escape codes, which keeps it lightweight and easy to run. There is a render loop, a small particle system, a few burst patterns, and some keyboard controls for launching rockets, triggering bursts, toggling finale mode, pausing, and quitting. Nothing too deep. Just enough structure to make the show feel varied.

I also leaned into the playful side of it. There are different shell patterns like chrysanthemum, ring, willow, palm, and crackle. Rockets leave trails. The background has stars. There is an automatic finale mode that ramps up the pace. None of this was necessary. That was the point.

Projects like this are a good reminder that programming does not always need to be optimized around utility. Sometimes it is enough to build something because it is amusing, visually satisfying, or slightly ridiculous. A CLI firework show definitely qualifies.

In the end, this was just for fun, and that is exactly why it was worth making.

If you want to try it yourself, run:

python -m fireworks

And if you want to interact with it:

  • space launches a rocket
  • r triggers a random burst
  • f toggles finale mode
  • p pauses
  • q quits

It is a small project, but it captures something I like about programming: sometimes a silly idea is reason enough.

Comments