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,
): ParticleBurstPoolParameters
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 spacedirection(BGE.Math.Vector) — centre of the conestyle(BGE.ParticleBurstStyle)
Returns
BGE.DrawableParticles— the emitter used, or invalid if every emitter was busy
activeBurstCount(): integer
How many emitters have live particles.
Returns
integer