"Sparklers" (an attempt at something animated)



https://pastebin.com/1wk5BnMW

A little toy of sorts that creates four dynamic rectangles which go off in cardinal directions.
The rectangles themselves start slow, then get faster, then slow again. The length of the rectangles is determined by their speed, which achieves a stretching effect.

Users can either click to get the "sparklers" on click, or press Enter to toggle random sparkles.

This was tougher than I thought it would be to get to work. I implemented all sorts of weird spaghetti things and trees of conditionals I probably could have optimized better, had I not placed undue time constraints on myself. I still encounter an issue where, if there's more than one "group" of sparklers onscreen, all of them will be deleted when the first one gets deleted. Which is strange, seeing as how they're all working on individual destruction flags and timers. So, for "random", I just spawn one at a time.

Comments

Popular posts from this blog

veins - a weird visual toy

Squeezy Circle

Audio-Reactive Drawing Machine