Exemplo n.º 1
0
        /// <summary>
        /// Creates a new particle emitter
        /// </summary>
        /// <param name="particleManager">Particle manager to use</param>
        /// <param name="particle">Particle to spawn</param>
        /// <param name="cooldownTime">Cooldown between particles (in ms)</param>
        /// <param name="spawnChance">Chance that this particle will spawn (per frame) when off cooldown</param>
        /// <param name="maxParticles">Max amount of particles</param>
        public ParticleEmitter(Vector2 position, ParticleManager particleManager, Particle particle, float cooldownTime, float spawnChance, int maxParticles, Random random)
        {
            this.position = position;
            this.particleManager = particleManager;
            this.particle = particle;
            this.cooldownTime = cooldownTime;
            this.spawnChance = spawnChance;
            this.maxParticleAmount = maxParticles;
            this.random = random;

            currentParticleAmount = 0;
            currentCooldownTime = 0.0f;

            instantSpawn = cooldownTime == 0.0f ? true : false;
        }
Exemplo n.º 2
0
 public void AddParticle(Particle particle)
 {
     particles.AddLast(particle);
 }