Esempio n. 1
0
        private void DrawRect(int x, int y)
        {
            Graphics  graphics  = base.CreateGraphics();
            Pen       pen       = new Pen(Color.Red);
            Rectangle rectangle = new Rectangle(x, y, snake.GetSize(), snake.GetSize());

            graphics.DrawRectangle(pen, rectangle);
        }
Esempio n. 2
0
 public Form1()
 {
     InitializeComponent();
     snake          = new Snake(Direction.Right, (100, 100), 20, 2);
     gameField      = new GameField((this.Width, this.Height), snake.GetSize());
     timer.Interval = 80;
     timer.Tick    += new EventHandler(TimerTick);
     timer.Start();
 }