Log In  


Fireworks

Cart #drakeblue_fireworks-3 | 2021-11-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
17

Some fairly simple particle fireworks just for fun.
Press X to switch the screen effect on/off. For more about that see here: https://www.lexaloffle.com/bbs/?tid=41149

Every sixth of a second, 50-100 Particles are emitted at a random point on the screen with random angle/velocity determined by a tiny bit of trig. They're given colours in the top half of the PICO-8 palette (7+) and as the particles get old the colour changes according to the same mapping that the screen fade effect uses to a darker colour.
If they run out of life or become black then the particles are deleted.
There are two possible update functions for each particle - one with a wiggle :)

-- update: tidied code a bit, updated fade effect.
-- update 2: added a flash when the fireworks detonate. Other tweaks. Happy Fifth of November :)

17


Nice work! :)


Nice!


The way the sparks wiggle as they fall is such a nice detail



[Please log in to post a comment]