Пример #1
0
 private void topLabel_MouseUp(object sender, MouseEventArgs e)
 {
     if (clickedRightColor && clickedRightName && clickedRightNameColor)
     {
         amountOfClicks++;
         clickingTimer.Stop();
         Console.WriteLine(clickingTimer.Elapsed.Minutes);
         EndGame egform = new EndGame();
         egform.Show();
         this.Hide();
         topLabel.ForeColor = Color.Black;
     }
 }
Пример #2
0
        private void topLabel_MouseUp(object sender, MouseEventArgs e)
        {
            /* If the Left Color Panel != Selected Color...
             * If the Right Color Text != Selected Color Text...
             * If the Right Color Text Color != Selected Color...
             * If the Top Label Text == "Click Here To Start"...
             * If you left-clicked (Mouse Up) the Top Label...
             */
            if (!clickedRightColor && !clickedRightName && !clickedRightNameColor && topLabel.Text == "Click Here To Start" && e.Button == MouseButtons.Left)
            {
                /* Top Label Text = Initial  Color Text.
                 * Sets the accurate and inaccurate clicks to 0.
                 * Starts the Timer and confirms that the Timer has started.
                 */
                topLabel.Text    = colorOutput;
                accurateClicks   = 0;
                inaccurateClicks = 0;
                clickingTimer.Start();
            }

            /* If the Left Color Panel Color == Selected Color...
             * If the Right Color Text = Selected Color Text...
             * If the Right Color Text Color = Selected Color...
             * If you left-clicked (Mouse Up) the Top Label...
             */
            else if (clickedRightColor && clickedRightName && clickedRightNameColor && e.Button == MouseButtons.Left)
            {
                /* Adds an accurate click.
                 * Clears the clipboard.
                 * Stops the Timer.
                 * Adds the seconds to an Integer.
                 * Resets the Timer.
                 * Top Label Color = Black.
                 * Closes this form and opens the EndGame form.
                 */
                accurateClicks++;
                System.Windows.Forms.Clipboard.Clear();
                clickingTimer.Stop();
                seconds = clickingTimer.Elapsed.Seconds;
                clickingTimer.Reset();
                topLabel.ForeColor = Color.Black;
                EndGame egform = new EndGame();
                egform.Show();
                this.Hide();
            }
            else
            {
                //Adds an inaccurate click.
                inaccurateClicks++;
            }
        }