ParticleBurstPool

Extends: GameEntity

Plays one-shot particle bursts anywhere in the world (hits, sparks, dust) from a small pool of emitters, so a burst doesn't create an entity, emitter and scene object each time. An emitter is reused once its particles have faded. Add one to the game, e.g. in a scene's onCreate():

m.bursts = new BGE.ParticleBurstPool(m.game) m.game.addEntity(m.bursts) m.bursts.play(hitPoint, swingDirection, bloodStyle)

Properties

  • maxEmitters (integer) — Most emitters it will make. When all are busy, play() drops the burst.
  • emitters (Array.<BGE.DrawableParticles>)

Constructor

new ParticleBurstPool( game: BGE.Game, args?: roAssociativeArray, ): ParticleBurstPool

Parameters

  • game (BGE.Game)
  • args (roAssociativeArray, optional, default: "{}")

Instance Methods

play( position: BGE.Math.Vector, direction: BGE.Math.Vector, style: BGE.ParticleBurstStyle, ): BGE.DrawableParticles

Sprays a burst at position, in a cone around direction.

Parameters

  • position (BGE.Math.Vector) — world space
  • direction (BGE.Math.Vector) — centre of the cone
  • style (BGE.ParticleBurstStyle)

Returns

activeBurstCount(): integer

How many emitters have live particles.

Returns

  • integer