コード例 #1
0
        private void Btn_Retry_Click(object sender, EventArgs e)
        {
            SnakeMovingTimer.Stop();
            SnakeParts = new Rectangle[0];
            Point center = new Point((int)Pb_Field.Width / 2, (int)Pb_Field.Height / 2);

            AddSnakePart(center);
            DrawSnake();
            Btn_Start.Enabled = true;
        }
コード例 #2
0
 private void Btn_Pause_Click(object sender, EventArgs e)
 {
     Btn_Pause.Enabled = false;
     if (SnakeMovingTimer.Enabled == true)
     {
         SnakeMovingTimer.Stop();
         Btn_Pause.ForeColor = Color.FromArgb(196, 110, 105);
     }
     else
     {
         SnakeMovingTimer.Start();
         Btn_Pause.ForeColor = Color.FromArgb(140, 196, 145);
     }
     Btn_Pause.Enabled = true;
 }