Ejemplo n.º 1
0
 /// <summary>
 /// Emit new particles.
 /// </summary>
 /// <param name="deltaTime">The time since the last frame.</param>
 protected void EmitParticles(float deltaTime)
 {
     // emit new particles
     for (int i = 0; i < emitters.Count; i++)
     {
         IParticleEmitter emitter = (IParticleEmitter)emitters[i];
         emitter.Update(this, deltaTime);
     }
 }
Ejemplo n.º 2
0
        public void Update(float elapsedTime)
        {
            var particle = _emitter.Update(elapsedTime);

            if (particle != null)
            {
                _particles.Insert(0, particle);
            }

            _particles.RemoveAll(p => p.Dead);
            _particles.ForEach(p => _emitter.UpdateParticle(elapsedTime, p));
        }