Esempio n. 1
0
        private void btnRestart_Click(object sender, EventArgs e)
        {
            SelelectionScreen sp = new SelelectionScreen();
            ReplacingBooks    rp = new ReplacingBooks();

            this.Close();
            this.Hide();
            sp.Show();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            callnum.Sort();
            if (answer.Count < 10)
            {
                MessageBox.Show("Please compelete all before checking your answer");
            }
            else
            {
                timer1.Enabled = false;
                string timelapsed = label1.Text;


                if (callnum.SequenceEqual(answer))
                {
                    MessageBox.Show("Well done! You have got it right");
                    if (attempt == 0)
                    {
                        MessageBox.Show("Achievement Unlocked! You have sorted it on your first attempt o_0");
                        label3.Visible = true;
                    }
                    if (attempt < 3)
                    {
                        MessageBox.Show("Achievement Unlocked! You have completed your first puzzle");
                        label3.Visible = true;
                    }
                }
                else
                {
                    MessageBox.Show("Oops! That's not correct Please try again");
                    groupBox1.Enabled = true;
                    answer.Clear();
                    UserAnswer.Items.Clear();
                    attempt++;
                    timer1.Enabled = true;
                    call1.Enabled  = true;
                    call2.Enabled  = true;
                    call3.Enabled  = true;
                    call4.Enabled  = true;
                    call5.Enabled  = true;
                    call6.Enabled  = true;
                    call7.Enabled  = true;
                    call8.Enabled  = true;
                    call9.Enabled  = true;
                    call10.Enabled = true;
                    if (attempt == 3)
                    {
                        MessageBox.Show("Achievement Unlocked! Failed attempts = 5");
                        label4.Visible = true;
                    }
                    if (attempt == 5)
                    {
                        MessageBox.Show("Achievement Unlocked! Failed attempts = 10");
                        label5.Visible = true;
                    }
                }
                if (attempt > 5)
                {
                    MessageBox.Show("Game Over");
                    SelelectionScreen sc = new SelelectionScreen();
                    this.Hide();
                    sc.Show();
                }
            }
        }