Particles
ParticleGenerator
ParticleGenerator is a Drawable that owns and draws a list of particles.
gen = bf.ParticleGenerator()
scene.add("world", gen)
gen.add_particle(
bf.BasicParticle(
(200, 100),
(50, -120),
duration=0.8,
color=(255, 200, 0),
)
)
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.