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); }
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(); }