Example #1
0
 public void Game_end()
 {
     if (MessageBox.Show("Фруктов съедено:" + Snake_Rect.get_fru_eat(),
                         "Конец!", MessageBoxButtons.OK) == DialogResult.OK)
     {
         Application.Exit();
     }
 }
Example #2
0
        public void move_draw()
        {
            Graphics snake = this.CreateGraphics();

            snake.DrawRectangle(new Pen(Color.DarkGreen), Snake_Rect.Get_Snake(Snake_Rect.Get_snake_count() - 1));
            snake.DrawRectangle(new Pen(Color.Black), Snake_Rect.Get_Snake(0));

            snake.FillRectangle(new SolidBrush(Color.DarkRed), Snake_Rect.fruit);

            label1.Text = "Фрукты:" + Snake_Rect.get_fru_eat();
        }
Example #3
0
        public void Snake_draw()
        {
            Graphics  snake = this.CreateGraphics();
            Rectangle bot   = new Rectangle(-10, 360, 800, 30);

            snake.Clear(Color.DarkOrange);
            snake.DrawRectangle(new Pen(Color.Black), Snake_Rect.Get_Snake(0));
            for (int i = 1; i < Snake_Rect.Get_snake_count(); i++)
            {
                snake.DrawRectangle(new Pen(Color.DarkGreen), Snake_Rect.Get_Snake(i));
            }
            snake.FillRectangle(new SolidBrush(Color.DarkRed), Snake_Rect.fruit);

            snake.FillRectangle(new SolidBrush(Color.White), bot);
            snake.DrawRectangle(new Pen(Color.Black), bot);
            label1.Text = "Фруктов:" + Snake_Rect.get_fru_eat();
        }