예제 #1
0
        public override void Update(double ElapsedTime)
        {
            base.Update(ElapsedTime);
            _Limiter.Update(ElapsedTime);
            if (_Limiter.Ready && _Effecting)
            {
                //Params:
                //0: x-speed
                //1: y-speed
                Particle p = new Particle(RNG.Next(-20, 20), RNG.Next(-20, 20), RNG.Next(200));
                p.TimeToLive = 20;
                p.X          = x;
                p.Y          = y;
                p.Color      = ColorPicker.Transparent(0);

                p.Transform += AdjustX;
                p.Transform += AdjustY;
                p.Transform += OpacityFunction;

                p.Model = AnimationFactory.GenerateAnimation("Images//particleloop.png", 32, 32, 5, 0.05);
                p.Image = p.Model.Frames[0];
                //p.Image = new Frame("Images\\particle.png", new System.Drawing.Rectangle(0, 0, 32, 32), 0);

                this.Add(p);
            }
        }
예제 #2
0
        public override void Update(double ElapsedTime)
        {
            base.Update(ElapsedTime);
            _Limiter.Update(ElapsedTime);
            if (_Limiter.Ready && _Effecting)
            {
                Particle p = new Particle(RNG.Next(320), RNG.Next(4) + 1, RNG.Next(12));
                p.TimeToLive = 5;
                p.X          = x;
                p.Y          = y;
                p.Color      = ColorPicker.FromArgb(0, ColorPicker.RandomColor());

                p.Transform += SinXFunction;
                p.Transform += SinYFunction;
                p.Transform += OpacityFunction;

                p.Model = AnimationFactory.GenerateAnimation("Images//particleloop.png", 32, 32, 5, 0.05);
                p.Image = p.Model.Frames[0];
                //p.Image = new Frame("Images\\particle.png", new System.Drawing.Rectangle(0, 0, 32, 32), 0);

                this.Add(p);
            }
        }