It was rainy today, so I made myself a pixel fire. It is the classic “Doom” fire effect, as described in Fabien Sanglard’s website.
The idea is to use a “heat” value for each pixel, that indexes into a color palette going from white to red to black. The bottom row of the frame buffer is initialized with the maximum heat, and you then iterate over the lines to propagate heat to the upper lines, with some randomness. It is a fun little exercise to code and a nice visual effect.
UPDATE(2024-05-20): last week I was at the Software You Can Love conference in Milan. The first day is a socializing day where people are given a micro-controller badge, and gather around tables to chat and program their badge using an embedded version of Zig. I took the opportunity to port my fire code to Zig and make it run on the badge, along with displaying my handle: