Exemple #1
0
        public Form1()
        {
            InitializeComponent();

            this.emitter = new Emitter
            {
                Width            = canvas.Width / 2,
                Height           = canvas.Height,
                GravitationY     = 1,
                ParticlesPerTick = 10
            };
            emitters.Add(this.emitter);


            canvas.Image = new Bitmap(canvas.Width, canvas.Height);

            point1 = new PaintPoint
            {
                X          = (float)(canvas.Width / 4),
                Y          = canvas.Height - 70,
                RoundColor = Color.Black
            };

            this.MouseWheel += new MouseEventHandler(this_MouseWheel);

            emitter.impactPoints.Add(point1);


            trackBar1.Minimum = 55;
            trackBar1.Maximum = canvas.Width - 50;
        }
Exemple #2
0
        private void radioButton1_CheckedChanged(object sender, EventArgs e) //Пaтриот мод
        {
            if (trackBar3.Value == 1)
            {
                BGColor = Color.Black;

                patriotpoint1 = new PaintPoint
                {
                    X          = (float)(canvas.Width / 2),
                    Y          = canvas.Height - 80,
                    RoundColor = Color.Red
                };
                emitter.impactPoints.Add(patriotpoint1);

                patriotpoint2 = new PaintPoint
                {
                    X          = (float)(canvas.Width / 2),
                    Y          = canvas.Height - 320,
                    RoundColor = Color.White,
                    Power      = 140
                };
                emitter.impactPoints.Add(patriotpoint2);

                patriotpoint3 = new PaintPoint
                {
                    X          = (float)(canvas.Width / 2),
                    Y          = canvas.Height - 190,
                    RoundColor = Color.Blue
                };
                emitter.impactPoints.Add(patriotpoint3);
                emitter.particles.Clear();
                emitter.ParticlesPerTick = 20;
                emitter.SpeedMax         = 20;
                emitter.MinRad           = 40;
                emitter.MaxRad           = 100;
            }
            else
            {
                BGColor = Color.White;
                emitter.impactPoints.Remove(patriotpoint1);
                emitter.impactPoints.Remove(patriotpoint2);
                emitter.impactPoints.Remove(patriotpoint3);
                emitter.particles.Clear();
                emitter.ParticlesPerTick = 10;
                emitter.SpeedMax         = maxSpeed.Value;
                emitter.MinRad           = 20;
                emitter.MaxRad           = 140;
            }
        }