Particles
ParticleGenerator
ParticleGenerator is a Drawable that owns and draws a list of particles.
gen = bf.ParticleGenerator()
scene.add(gen) # Dev: flat scene. Release: scene.add("world", gen)
gen.emit( # Release uses add_particle(...)
bf.BasicParticle(
(200, 100),
(50, -120),
duration=0.8,
color=(255, 200, 0),
)
)
- Dev:
emit(*particles)· Release:add_particle(particle) clear()
Particle types
| Class | Role |
|---|---|
Particle | Base particle |
TimedParticle | Auto-kills after a duration |
BasicParticle | Moves with velocity and fades out |
DirectionalParticle | Like basic, rotates to face velocity |
See the Fireworks example for a full demo.