Exemplo n.º 1
0
 //Devolverse al menu anterior
 private void labelReturn_Click(object sender, EventArgs e)
 {
     InitializeComponent();
     m5to = new Menu5toGrado();
     m5to.Show();
     this.Hide();
 }
Exemplo 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 tableLayoutPanel5toGrado.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();
            m5grado = new Menu5toGrado();
            m5grado.Show();
            this.Hide();
            //Close();
        }
Exemplo n.º 3
0
 private void button5_Click(object sender, EventArgs e)
 {
     InitializeComponent();
     m5grado = new Menu5toGrado();
     m5grado.Show();
     this.Hide();
 }
Exemplo n.º 4
0
        private void backB_Click(object sender, EventArgs e)
        {
            Menu5toGrado m5 = new Menu5toGrado();

            this.Hide();
            m5.Show();
        }
Exemplo n.º 5
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();
                m5to = new Menu5toGrado();
                m5to.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;
        }