Exemplo n.º 1
0
        public Tireur(Rectangle rectangle, ContentManager Content, int height, int width, quaintuplet quaint)
        {
            this.rectangle = rectangle;
            this.rectangle_C = rectangle;
            this.decallageX = 0; decallageY = 0;
            largeurX = rectangle.Width - decallageX; hauteurY = rectangle.Height - decallageY;
            this.width = width;
            dir = -1;

            bullet = new Bullet_manager( new Rectangle(rectangle.X, rectangle.Y, 10, 50), 15, quaint.bullet_Speed,
                Content.Load<SoundEffect>("hero//vaisseau//tir2"), quaint.color, width, quaint.firerate);

            timer_lunch = quaint.seconde;
            _speed = quaint.speed;
            vie = quaint.vie;
            trajectory = quaint.trajectory;
            FrameColunm  = 1;
        }
Exemplo n.º 2
0
        private void modif(int spawn, string type)
        {
            if (type == "IA_K")
            {
                couple cople = new couple();
                cople.vie = int.Parse(textBox4.Text);
                cople.speed = int.Parse(textBox5.Text);
                cople.damage = int.Parse(textBox12.Text);
                cople.X = savefile.ia_Kamikaze[spawn].X;
                cople.Y = savefile.ia_Kamikaze[spawn].Y;
                savefile.ia_Kamikaze[spawn] = cople;
                manage_k.remove_all();
                for (int i = 0; i < savefile.ia_Kamikaze.Count; i++)
                    manage_k.Add(cople, i);
            }
            else if (type == "b")
            {
                Bonus bonu = new Bonus();
                bonu.speed = int.Parse(textBox17.Text);
                bonu.angle = int.Parse(textBox18.Text);
                bonu.launch = savefile.bonus[spawn].launch;
                bonu.X = openX;
                bonu.Y = openY;
                char types = savefile.bonus[spawn].type;
                if (radioButton3.Checked)
                    types = 'v';
                else if (radioButton4.Checked)
                    types = 'b';
                else if (radioButton5.Checked)
                    types = 'm';
                else if (radioButton6.Checked)
                    types = 'p';
                else if (radioButton7.Checked && textBox18.BackColor == System.Drawing.Color.Green &&
            textBox17.BackColor == System.Drawing.Color.Green)
                {
                    if (radioButton8.Checked)
                        types = 'a';
                    else if (radioButton9.Checked)
                        types = 'c';
                    else if (radioButton10.Checked)
                        types = 's';
                }
                bonu.type = types;
                savefile.bonus[spawn] = bonu;
                ovni.remove_all();
                for (int i = 0; i < savefile.bonus.Count; ++i)
                    ovni.Add(savefile.bonus[i].type, savefile.bonus[i].X, savefile.bonus[i].Y, i);
            }
            else
            {
                quaintuplet quaint = new quaintuplet();
                quaint.color = new Microsoft.Xna.Framework.Color(color2.R, color2.G, color2.B, color2.A);
                quaint.damage = int.Parse(textBox13.Text);
                quaint.firerate = int.Parse(textBox6.Text);
                quaint.nombre = int.Parse(textBox3.Text);
                quaint.seconde = seconde;
                quaint.speed = int.Parse(textBox2.Text);
                quaint.trajectory = (string)comboBox4.SelectedItem;
                quaint.vie = int.Parse(textBox1.Text);

                quaint.bullet_Speed = int.Parse(textBox15.Text);

                if (type == "IA_V")
                {
                    quaint.X = savefile.ia_viseur[spawn].X;
                    quaint.Y = savefile.ia_viseur[spawn].Y;
                    savefile.ia_viseur[spawn] = quaint;
                    manage_V.remove_all();
                    for (int i = 0; i < savefile.ia_viseur.Count; ++i)
                        manage_V.Add(savefile.ia_viseur[i], i);
                }
                else if (type == "IA_T")
                {
                    quaint.X = savefile.ia_tireur[spawn].X;
                    quaint.Y = savefile.ia_tireur[spawn].Y;
                    savefile.ia_tireur[spawn] = quaint;
                    manage_T.remove_all();
                    for (int i = 0; i < savefile.ia_tireur.Count; ++i)
                        manage_T.Add(savefile.ia_tireur[i], i);
                }

            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// add pour jouer
 /// </summary>
 /// <param name="quaint"></param>
 public void Add(quaintuplet quaint)
 {
     for (int i = 0; i < quaint.nombre; ++i)
         ia_manage.Add(new Viseur_aI( new Rectangle((int)(quaint.X * window_W) + i * _rectangle.Width, -_rectangle.Height, _rectangle.Width, _rectangle.Height),
             Content, window_H, window_W, quaint));
 }
Exemplo n.º 4
0
        // tab viseur et tireur
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.BackColor == System.Drawing.Color.Green && textBox2.BackColor == System.Drawing.Color.Green &&
                textBox3.BackColor == System.Drawing.Color.Green && textBox6.BackColor == System.Drawing.Color.Green &&
                textBox13.BackColor == System.Drawing.Color.Green && textBox15.BackColor == System.Drawing.Color.Green &&
                color2 != System.Drawing.Color.Black)//+combobox4 a veriff
            {
                if (spawn == -1)
                {
                    quaintuplet quaint = new quaintuplet();
                    quaint.color = new Microsoft.Xna.Framework.Color(color2.R, color2.G, color2.B, color2.A);
                    quaint.damage = int.Parse(textBox13.Text);
                    quaint.firerate = int.Parse(textBox6.Text);
                    quaint.nombre = int.Parse(textBox3.Text);
                    quaint.seconde = seconde;
                    quaint.speed = int.Parse(textBox2.Text);
                    quaint.trajectory = (string)comboBox4.SelectedItem;
                    quaint.vie = int.Parse(textBox1.Text);
                    quaint.bullet_Speed = int.Parse(textBox15.Text);
                    quaint.X = openX;
                    quaint.Y = openY;

                    if (radioButton1.Checked)
                    {
                        savefile.ia_tireur.Add(quaint);
                        manage_T.Add(quaint, manage_T.Ia_manage.Count);
                        this.hidou();
                    }
                    else if (radioButton2.Checked)
                    {
                        savefile.ia_viseur.Add(quaint);
                        manage_V.Add(quaint, manage_V.Ia_manage.Count);
                        this.hidou();
                    }
                }
                else
                {
                    modif(spawn, ia_type);
                    this.hidou();
                }
            }
        }
Exemplo n.º 5
0
 public void Add(quaintuplet quaint, int spawn)
 {
     for (int i = 0; i < quaint.nombre; ++i)
         ia_manage.Add(new Tireur( new Rectangle((int)(quaint.X * window_W) + i * _rectangle.Width, (int)(quaint.Y * window_H), _rectangle.Width, _rectangle.Height),
             Content, window_H, window_W, quaint, spawn));
 }