Campfire
This is just me trying to simulate fire in Pico8 without shaders or fancy particle systems.
My approach is :
- At load time :
- Generate bursts of animated particles
- Each particle increments the brightness value for the pixels it sits on
- The burst animations are baked into the spritesheet
- At run time :
- Animate the baked sprites (moving them up)
- Again, add the brightness values together
The brightness value (which is just a color from 0 to 7) is mapped to a fire shade with pal().
There are other particle systems for bursts of sparkles and fireflies.
Any thought? What would be your approach?
v2 update
- use colors 0 to 7 for fire shades : no table needed to store brightness values
- bake animations into spritesheet for performance
- got rid of smoke
- add flickering
- nicer fireflies and flying ember
- add clouds
v3 update
- press a button to toggle scene on/off (monitor CPU usage of fire only)
P#118338 2022-10-01 23:56 ( Edited 2022-10-02 22:14)
[Please log in to post a comment]