All projects

Fire Animation

Retro Fire in Java Swing

Year
2026
Disciplines
  • Development
  • 2D
  • Java
Tools
  • Java
  • Swing
Links

A retro fire effect in Java Swing, made as an exercise for the Introduction to Video Games module. The brief: simulate fire from a grid of temperatures, structure the code with Model-View-Presenter and run the simulation on its own thread. The full source is on GitHub.

Fire from a grid of numbers View full size
01

Fire from a grid of numbers

The window has the controls on the left and the fire on the right. The fire is a grid of temperatures from 0 to 255. Each frame lights random sparks on the bottom row and cools others, then every cell takes the average of itself and the three cells below, with a little noise and a cooling constant. A palette of 256 precomputed colours turns each temperature into a pixel. The exercise also set the architecture: the view and the model only talk through the presenter, and the model updates the fire about 30 times per second on its own thread, drawing into a back buffer so a half-painted frame never reaches the screen. Stop doesn't cut the fire: it dies out over two seconds.

Palettes and controls View full size
02

Palettes and controls

Six preset palettes (fire, blue, green, violet, cyan and rainbow) or a palette built from any of 16 colours. Screen sizes of classic systems such as VGA or SNES, plus custom ones, and sliders for sparks, cold points, randomness and cooling. Every change applies while the fire is running.

Kalyx Community Shirt A Realistic Shirt for a Calisthenics Gym View project