public void UpdateForm() { graphics.Clear(this.BackColor); DrawBorder(); label3.Text = score.ToString(); snake.SetDirection(NewDirection(newDirection)); snake.Move(apple); snake.DrawSnake(graphics); apple.Draw(graphics); }
public void BtnStartCode() { if (tbName1.Text != "") { // Если ввели имя btnStart.Visible = false; //скрываем кнопку, надпись и текстбокс tbName1.Visible = false; label1.Visible = false; btnRestart.Visible = true; btnExit.Visible = true; label2.Text = tbName1.Text + ":"; // выводим имя label3.Text = score.ToString(); // и очки apple = new Fruits(); snake = new Snake(); //apple.DrawCircle(graphics); apple.Draw(graphics); snake.DrawSnake(graphics); DrawBorder(); } }