Start() private method

private Start ( ) : void
return void
Ejemplo n.º 1
0
        private void Symbol_Click(object sender, EventArgs e)
        {
            if (firstClick != null && secondClick != null)
            {
                return;
            }

            Label clickedLabel = sender as Label;

            if (clickedLabel == null)
            {
                return;
            }

            if (clickedLabel.ForeColor == Color.Black)
            {
                return;
            }

            if (firstClick == null)
            {
                firstClick           = clickedLabel;
                firstClick.ForeColor = Color.Black;
                return;
            }
            secondClick           = clickedLabel;
            secondClick.ForeColor = Color.Black;
            if (firstClick.Text == secondClick.Text)
            {
                firstClick  = null;
                secondClick = null;

                Win.Start();
                MessageBox.Show("You Win");

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

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

            else
            {
                Reset.Start();
            }
        }