Beispiel #1
0
        public override Particle CreateParticle()
        {
            var particle = ParticleImage.Generation();

            particle.FromColor = Color.Yellow;
            particle.ToColor   = Color.FromArgb(0, Color.Magenta);
            particle.X         = Position.X;
            particle.Y         = Position.Y;
            return(particle);
        }
Beispiel #2
0
        public Color ToColor   = Color.White; // конечный цвет

        public override Particle CreateParticle()
        {
            var particle = ParticleImage.Generation();

            particle.FromColor = this.FromColor;
            particle.ToColor   = Color.FromArgb(0, this.ToColor);
            particle.Speed     = 1 + Particle.rand.Next(30);
            particle.Direction = this.Direction + Particle.rand.Next(-Spread / 2, Spread / 2);

            particle.X = Position.X;
            particle.Y = Position.Y;

            return(particle);
        }
Beispiel #3
0
        public override void ResetParticle(Particle particle)
        {
            ParticleImage particleColorful = particle as ParticleImage;

            if (particleColorful != null)
            {
                particleColorful.Life  = 20 + Particle.rand.Next(40000);
                particleColorful.Speed = 2 + Particle.rand.Next(0, 6);

                particleColorful.FromColor = this.FromColor;
                particleColorful.ToColor   = Color.FromArgb(0, this.ToColor);
                particleColorful.Direction = this.Direction + Particle.rand.Next(-Spread / 2, Spread / 2);

                particleColorful.X = Position.X;
                particleColorful.Y = Position.Y;
            }
        }