Esempio n. 1
0
 private void buttonReturn_Click(object sender, EventArgs e)
 {
     InitializeComponent();
     m4grado = new Menu4toGrado();
     m4grado.Show();
     this.Hide();
 }
Esempio n. 2
0
        private void CheckForWinner() //Revisa que los colores de las imagenes y el fondo NO sean iguales
        {
            // Go through all of the labels in the TableLayoutPanel,
            // checking each one to see if its icon is matched
            foreach (Control control in tableLayoutPanel4toGrado.Controls)
            {
                Label iconLabel = control as Label;

                if (iconLabel != null)
                {
                    //Para que solo se gane cuando el tablero esté vacío
                    if (iconLabel.ForeColor != iconLabel.BackColor)
                    {
                        return;
                    }
                }
            }

            // If the loop didn’t return, it didn't find
            // any unmatched icons
            // That means the user won. Show a message and close the form
            sonidos.sonidoTerminarBien();
            MyMsgBox.Show("YOU MATCHED ALL THE WORDS!", ":)", "OK");
            InitializeComponent();
            m4grado = new Menu4toGrado();
            m4grado.Show();
            this.Hide();
            //Close();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Menu4toGrado mp = new Menu4toGrado();

            mp.Show();
            this.Hide();
        }
Esempio n. 4
0
        //Que esto ocurra siempre que el juego inicie y cuando se confirme que una respuesta es correcta
        private void asignarPregYResp()
        {
            sameBackColor();

            if (i + 1 < questions.Length)
            {
                i++;
            }
            else
            {
                if (score > 6)
                {
                    sonidos.sonidoTerminarBien();
                }
                else
                {
                    sonidos.sonidoTerminar();
                }
                MyMsgBox.Show("FINISH!\nFinal score: " + +score + " / " + questions.Length.ToString(), "", "OK");
                InitializeComponent();
                m4to = new Menu4toGrado();
                m4to.Show();
                this.Hide();
                return;
            }

            KeyValuePair <string[], int> pair;

            labelQuant.Text = (i + 1).ToString() + " / " + questions.Length.ToString() +
                              "                  Score: " + score + " / " + questions.Length.ToString();

            labelQuestion.Text = questions[i];
            Image im = imageList1.Images[i]; //La imagen de la lista de imagenes

            labelQuestion.Image = im;
            int    cant;
            Random rand = new Random();

            numbers = new int[4] {
                0, 1, 2, 3
            };
            pair = allAnswers.ElementAt(i);
            labelAnswer1.Text = pair.Key[numbers[cant = rand.Next(0, numbers.Length)]];
            numbers           = numbers.Where(w => w != numbers[cant]).ToArray();
            labelAnswer2.Text = pair.Key[numbers[cant = rand.Next(0, numbers.Length)]];
            numbers           = numbers.Where(w => w != numbers[cant]).ToArray();
            labelAnswer3.Text = pair.Key[numbers[cant = rand.Next(0, numbers.Length)]];
            numbers           = numbers.Where(w => w != numbers[cant]).ToArray();
            labelAnswer4.Text = pair.Key[numbers[cant = rand.Next(0, numbers.Length)]];
            //numbers = numbers.Where(w => w != numbers[cant]).ToArray();

            labelNext.Visible = false;
        }
Esempio n. 5
0
 private void backB_Click(object sender, EventArgs e)
 {
     m4 = new Menu4toGrado();
     this.Hide();
     m4.Show();
 }