INNER CODE UNIT · Python
alive
tuangauss/DataScienceProjects · Python/fireworks.py:85
def alive(self):
return self.age <= self.lifespan
'''
Firework simulation loop:
Recursively call to repeatedly emit new fireworks on canvas
a list of list (list of stars, each of which is a list of particles)
is created and drawn on canvas at every call,
via update protocol inside each 'part' object
'''
def simulate(cv):
t = time()
explode_points = []
wait_time = randint(10,100)
numb_explode = randint(6,10)
# create list of list of all particles in all simultaneous explosion
for point in range(numb_explode):