예제 #1
0
 //Devolverse al menu anterior
 private void labelReturn_Click(object sender, EventArgs e)
 {
     InitializeComponent();
     m2do = new Menu2doGrado();
     m2do.Show();
     this.Hide();
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     InitializeComponent();
     m2grado = new Menu2doGrado();
     m2grado.Show();
     this.Hide();
 }
예제 #3
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 tableLayoutPanel2doGrado.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();
            m2grado = new Menu2doGrado();
            m2grado.Show();
            this.Hide();
            return;
        }
예제 #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();
                m2do = new Menu2doGrado();
                m2do.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;
        }
예제 #5
0
 private void backB_Click(object sender, EventArgs e)
 {
     m2 = new Menu2doGrado();
     this.Hide();
     m2.Show();
 }