Exemple #1
0
 /// <summary>
 /// A private method that will change the attributes of the passed in particle to fit the emitter's description.
 /// </summary>
 /// <param name="particle">The particle to change.</param>
 /// <remarks>Use this method when overriding the CreateParticle method.</remarks>
 /// <returns>The particle with the changed properties.</returns>
 private BaseParticle SetParticleBaseAttributes(BaseParticle particle)
 {
     if (particle == null)
     {
         return null;
     }
     particle.Life = Random.Next(m_LifeMin, m_LifeMax);
     particle.LifeFull = Random.Next(m_LifeFullMin, m_LifeFullMax);
     particle.Velocity = new Vector(GetRange(m_DirectionMin, m_DirectionMax));
     Vector vel = particle.Velocity;
     vel.Length = GetRange(m_SpeedMin, m_SpeedMax);
     particle.Velocity = vel;
     //particle.Velocity.Length = GetRange(m_SpeedMin, m_SpeedMax);
     particle.X = GetRange(this.X, this.X + m_Width);
     particle.Y = GetRange(this.Y, this.Y + m_Height);
     return particle;
 }
Exemple #2
0
 /// <summary>
 /// Adds a particle to the system.
 /// </summary>
 /// <param name="particle"></param>
 public void Add(BaseParticle particle)
 {
     m_Particles.Add(particle);
 }
 /// <summary>
 /// Adds a particle to the system.
 /// </summary>
 /// <param name="particle"></param>
 public void Add(BaseParticle particle)
 {
     m_Particles.Add(particle);
 }