public void update ( int delta ) { if ( ( sprite == null ) && ( defaultImageName != null ) ) { loadSystemParticleImage ( ) ; } removeMe . clear ( ) ; ArrayList emitters = new ArrayList ( this . emitters ) ; for ( int i = 0 ; i < emitters . size ( ) ; i ++ ) { ParticleEmitter emitter = ( ParticleEmitter ) emitters . get ( i ) ; if ( emitter . isEnabled ( ) ) { emitter . update ( this , delta ) ; if ( removeCompletedEmitters ) { if ( emitter . completed ( ) ) { removeMe . add ( emitter ) ; particlesByEmitter . remove ( emitter ) ; } } } } this . emitters . removeAll ( removeMe ) ; pCount = 0 ; if ( ! particlesByEmitter . isEmpty ( ) ) { Iterator it = particlesByEmitter . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { ParticleEmitter emitter = ( ParticleEmitter ) it . next ( ) ; if ( emitter . isEnabled ( ) ) { ParticlePool pool = ( ParticlePool ) particlesByEmitter . get ( emitter ) ; for ( int i = 0 ; i < pool . particles . length ; i ++ ) { if ( pool . particles [ i ] . life > 0 ) { pool . particles [ i ] . update ( delta ) ; pCount ++ ; } } } } } }
Update the system request the assigned emitters update the particles