18 Jun
2022
18 Jun
'22
3:17 a.m.
class Particle: def __init__(self, x, y, duration, xv = 0, yv = 0): self.x = x self.y = y self.t = duration self.xv = xv self.yv = yv def update(self, time): self.x += self.xv * time self.y += self.yv * time self.t -= duration return self.t >= 0 class ParticleGenerator: def __init__(self, rate): self.particles = [] self.rate = rate self.time_modulus = 0 def update(self, time): new_particle_count =