This is a p5.js sketch to explore forest fires (aka wildfires), their propagation and suppression.
Fires have intensity (yellow to red) and spread to surrounding green (fuel) areas, and can fully exhaust the fuel (black, charred areas) and users can create fire breaks (remove green fuel) to control the spread.
Currently, fire needs 2 adjacent cells to be on fire for it to propagate; so two clicks to
l or two mouse clicks after choosing the Lightning tool (
l- Triggers Lightning, igniting one of the green (foliage) cells.
p- Saves a screenshot of the sketch to your Downloads folder.
This sketch has a concept of ‘tools’ or cursor modes, which alter the behavior of clicking within the sketch.
L- Triggers Lightning beneath the mouse cursor
f- Turns a FOLLIAGE (green) cell into a SOIL (brown) cell, preventing fire from propagating to it.
k- ‘Knocks-down’ the fire where clicked.
seed- Using the same seed and reloading the page will result in the same terrain. (Example)
cellWidth- Controls how big each cell is. (Default is 20px). (Example)