Skip to main content
Version: Dev

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​

ClassRole
ParticleBase particle
TimedParticleAuto-kills after a duration
BasicParticleMoves with velocity and fades out
DirectionalParticleLike basic, rotates to face velocity

See the Fireworks example for a full demo.