public Particle getNewParticle ( ParticleEmitter emitter , float life ) { ParticlePool pool = ( ParticlePool ) particlesByEmitter . get ( emitter ) ; ArrayList available = pool . available ; if ( available . size ( ) > 0 ) { Particle p = ( Particle ) available . remove ( available . size ( ) - 1 ) ; p . init ( emitter , life ) ; p . setImage ( sprite ) ; return p ; } Log . warn ( "Ran out of particles (increase the limit)!" ) ; return dummy ; }
Get a new particle from the system . This should be used by emitters to request particles