Пример #1
0
        private void Jeu_Load(object sender, EventArgs e)
        {
            plateau     = new MonBouton[8, 8];
            label3.Text = annulerCounter.ToString();
            this.Text   = "Cavalier";

            for (int l = 0; l < 8; l++)
            {
                for (int c = 0; c < 8; c++)
                {
                    MonBouton b = new MonBouton(l, c);
                    b.Location = new Point(50 + l * 55, 50 + c * 55);
                    b.Size     = new Size(55, 55);
                    b.Click   += new EventHandler(this.buttonPlateau_Click);
                    this.Controls.Add(b);
                    plateau[l, c] = b;
                }
            }

            this.couleurPlateau = Color.LightSteelBlue;
            setCouleurs();
        }
Пример #2
0
        private void Simulation_Load(object sender, EventArgs e)
        {
            plateau = new MonBouton[8, 8];

            for (int l = 0; l < 8; l++)
            {
                for (int c = 0; c < 8; c++)
                {
                    MonBouton b = new MonBouton(l, c);
                    b.Location = new Point(l * 55, c * 55);
                    b.Size     = new Size(55, 55);
                    b.Click   += new EventHandler(this.buttonPlateau_Click);
                    this.Controls.Add(b);
                    plateau[l, c] = b;
                }
            }

            button4.Enabled = false;
            button5.Enabled = false;
            button6.Enabled = false;
            label2.Visible  = false;

            if (isAbandonner)
            {
                button1.Enabled  = false;
                button2.Enabled  = false;
                textBox1.Enabled = false;
                textBox2.Enabled = false;
                textBox3.Enabled = false;
                listBox1.Enabled = false;
                label4.Visible   = false;
                this.pos[0]      = jeu.getPosX();
                this.pos[1]      = jeu.getPosY();
                label2.Visible   = true;
                this.secondes    = 1000;
            }
        }
Пример #3
0
        private void buttonPlateau_Click(object sender, EventArgs e)
        {
            MonBouton b = sender as MonBouton;


            if (b.atteignable == true && b.dejaPassé == false)
            {
                label5.Text = "";

                plateau[this.pos[0], this.pos[1]].Text = counterPos.ToString();
                this.counterPos++;

                plateau[this.pos[0], this.pos[1]].Image = null;

                this.pos[0] = b.L;
                this.pos[1] = b.C;

                b.dejaPassé = true;
                afficherJoueur();
                ajouterCurrentJoueurPos();
                afficherCasesUsées();
                afficherPossibilite(pos[0], pos[1]);
            }
        }