ParticleExplosion

class ParticleExplosion(epicentre: Vec2, noOfParticles: Int, lifespan: Double)

Models particle explosions.

Parameters

epicentre

Vector location of explosion epicenter.

noOfParticles

Total number of particles the explosion has.

lifespan

The life time of the particle.

Constructors

Link copied to clipboard
fun ParticleExplosion(epicentre: Vec2, noOfParticles: Int, lifespan: Double)

Functions

Link copied to clipboard
fun applyBlastImpulse(blastPower: Double)

Applies a blast impulse to all particles created.

Link copied to clipboard
fun createParticles(size: Double, density: Int, radius: Int, world: World)

Creates particles in the supplied world.

Properties

Link copied to clipboard
val particles: MutableList<Body>

Getter to return the list of particles in the world.