Beispiel #1
0
        private void InitializeGame()
        {
            this.Controls.Add(area);
            this.Controls.Add(food);
            food.BringToFront();
            this.KeyDown += Game_Keydown;
            this.Size     = new Size(615, 625);

            snake.Render(this);
        }
Beispiel #2
0
        private void InitializeGame()
        {
            this.Height = 600;
            this.Width  = 600;

            this.Controls.Add(area);
            area.Top  = 100;
            area.Left = 100;

            score = 0;

            snake.Render(this);

            this.Controls.Add(food);
            food.BringToFront();
            SetFoodLocation();

            this.KeyDown += new KeyEventHandler(Game_KeyDown);
        }
Beispiel #3
0
        private void InitializeGame()
        {
            this.Height = 600;
            this.Width  = 600;
            this.Controls.Add(area);
            area.Top  = 80;
            area.Left = 80;

            //set score to 0
            score = 0;

            //adding snake body
            snake.Render(this);

            //adding food to the game
            this.Controls.Add(food);
            food.BringToFront();
            SetFoodLocation();

            //add keyboard controller handler
            this.KeyDown += new KeyEventHandler(Game_KeyDown);
        }