예제 #1
0
        /// <summary>
        /// Creates the particles.
        /// This method is made to be overwriten
        /// By customising this function, the particle
        /// behavior can be customized
        /// </summary>
        protected virtual void CreateParticles(int number, TimeSpan lifeTime)
        {
            for (int i = 0; i < number; ++i)
            {
                DrawableParticle particle = new DrawableParticle(lifeTime, ParticleInitialVelocity, ParticleForce,
                                                                 ParticleLifeTimeRandomizer, ParticleVelocityRandomizer, ParticleForceRandomizer,
                                                                 ParticleAlphaPercent)
                {
                    Origin = new Vector2(0.5f * ParticleTexture.Width, 0.5f * ParticleTexture.Height),
                    Scale  = ParticleScale
                };
                particle.Tint = Tint;

                Particles.Add(particle);
            }
        }
예제 #2
0
		/// <summary>
		/// Creates the particles.
		/// This method is made to be overwriten
		/// By customising this function, the particle 
		/// behavior can be customized
		/// </summary>
		protected virtual void CreateParticles(int number, TimeSpan lifeTime)
		{
			for (int i = 0; i < number; ++i) {
				DrawableParticle particle = new DrawableParticle(lifeTime, ParticleInitialVelocity, ParticleForce, 
				                                                 ParticleLifeTimeRandomizer, ParticleVelocityRandomizer, ParticleForceRandomizer, 
				                                                 ParticleAlphaPercent) { Origin = new Vector2(0.5f * ParticleTexture.Width, 0.5f * ParticleTexture.Height), 
																 Scale = ParticleScale };
				particle.Tint = Tint;

				Particles.Add(particle);
			}
		}