Please sign in to access this page
Something festive for the holidays! A simple firework simulation program.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
I first refactored my code by making Firework an extension type, and adding a copyWith and getters. I then made my app use a Material app with Theme.dark(). Then, I added a slider that changed the probability of fireworks appearing, in what is probably a logarithmic scale (1 is 100%/tick, 2 is 50%/tick, 3 is 33%/tick).
First, i fixed the transparancy issue (turns out i was doing |0xff000000
inside random.nextint instead of outside).
Then I made the fireworks start at the bottom and go up until they hit a random y coordinate, and then grow.
Then I made the fireworks fade out instead of popping out of existence.
I created a StatefulWidget, and used SingleTickerProviderStateMixin to make a ticker that:
- occasionally adds a random firework to the list of fireworks
- grows every firework, except it occasionally deletes a firework
I used Stack+Positioned+Container to render each firework as a circle.
I still need to figure out why they're semi transparent, and make it come from the bottom to look like a firework.