A lightweight terminal fire animation written in Python using the built-in curses library. Inspired by classic Doom-style fire effects, this script renders an animated ASCII flame simulation directly in your terminal.
fire.py creates a real-time fire effect by simulating heat diffusion across a grid mapped to the terminal screen. Intensity is represented using both ASCII characters and terminal colors, producing a smooth, flickering flame animation.
The program runs until any key is pressed.
- Real-time animated fire effect
- ASCII character intensity ramp
- Color-based heat visualization
- Automatically adapts to terminal size
- No external dependencies
- Clean exit on keypress
- Python 3.6+
- A Unix-like terminal with color support
curses(included with Python on Linux and macOS)
Clone the repository:
git clone https://github.com/DouglasFreshHabian/TerminalFire.git
cd TerminalFireEnsure the script is executable (optional):
chmod +x fire.pyRun the script from a terminal:
python3 fire.pyor, if executable:
./fire.pyPress any key to exit.
-
The bottom row of the terminal acts as a heat source.
-
Heat values diffuse upward using a simple averaging algorithm.
-
Each cell’s heat maps to:
- an ASCII character (density)
- a color pair (intensity)
-
The buffer updates continuously to create motion.
This approach is efficient and well-suited for real-time terminal animation.
If TerminalFire™ added to your Terminal, consider supporting continued development:
