Exemplo n.º 1
0
        private void countdownTimer_Tick(object sender, EventArgs e)
        {
            int timer = Convert.ToInt32(lblTimer.Text);

            timer         = timer - 1;
            lblTimer.Text = Convert.ToString(timer);
            if (timer == 0)
            {
                Win.Start();
                MessageBox.Show("You Win");
                countdownTimer.Stop();
                this.Close();

                Random rnd        = new Random(); // randomly chooses a minigame
                int    gamePicker = rnd.Next(1, 3);

                if (gamePicker == 1)
                {
                    var Game3 = new Game3();
                    Game3.Show();
                }

                else
                {
                    var Game4 = new Game4();
                    Game4.Show();
                }
            }
        }
Exemplo n.º 2
0
        private void clickImage(object sender, EventArgs e)
        {
            if (!allowclick)
            {
                return;
            }
            var pic = (PictureBox)sender;

            if (firstGuess == null)
            {
                firstGuess = pic;
                pic.Image  = (Image)pic.Tag;
                return;
            }
            pic.Image = (Image)pic.Tag;
            if (pic.Image == firstGuess.Image && pic != firstGuess)
            {
                pic.Visible = firstGuess.Visible = false;
                {
                    firstGuess = pic;
                }
                HideImages();
            }
            else
            {
                allowclick = false;
                clickTimer.Start();
            }
            firstGuess = null;
            if (pictureBoxes.Any(p => p.Visible))
            {
                return;
            }
            {
                timer.Stop();
                Win.Start();
                MessageBox.Show("You Win");
                Random rnd        = new Random(); // // randomly chooses a minigame
                int    gamePicker = rnd.Next(1, 3);

                if (gamePicker == 1)
                {
                    var Game4 = new Game4();
                    Game4.Show();
                }

                else
                {
                    var Game1 = new Game1();
                    Game1.Show();
                }
            }
        }
Exemplo n.º 3
0
        private void btnGame1_Click(object sender, EventArgs e)
        {
            Random rnd        = new Random(); // randomly chooses a minigame
            int    gamePicker = rnd.Next(1, 4);

            if (gamePicker == 1)
            {
                var Game4 = new Game4();
                Game4.Show();
            }

            else if (gamePicker == 2)
            {
                var Game3 = new Game3();
                Game3.Show();
            }
            else
            {
                var Game1 = new Game1();
                Game1.Show();
            }
        }