Please sign in to access this page

Fireworks

Fireworks

3 devlogs
1h 6m
•  Ship certified
Created by Tree Plate

Something festive for the holidays! A simple firework simulation program.

Timeline

Ship 1

1 payout of shell 8.0 shells

Tree Plate

about 1 month ago

Tree Plate Covers 3 devlogs and 1h 6m

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).

Update attachment

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.

Update attachment

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.

Update attachment