예제 #1
0
        private void aTimeModeTimer_Tick(object sender, EventArgs e)
        {
            timeTick++;
            aScoreLabel.Text = String.Format("{0}:{1:d2}", timeTick / 60, timeTick % 60);
            timeLeft--;
            Thread thread = new Thread(CheckTime);

            thread.Start();


            if (timeLeft <= 0)
            {
                aTimer.Enabled = false;
                SoundPlayer sound = new SoundPlayer(Properties.Resources.TimeOut);
                sound.Play();

                snake.DieAndShowBloodstain();

                for (int j = 1; j <= snake.tail.Count - 1; j++)
                {
                    snake.tail[j].BringToFront();
                }

                aTimeModeTimer.Enabled = false;

                EnableMenu(true);
            }
        }