Esempio n. 1
0
        private void eat()
        {
            SnakePart body = new SnakePart
            {
                X = Snake[Snake.Count - 1].X,
                Y = Snake[Snake.Count - 1].Y
            };

            Snake.Add(body);
            Settings.Score += Settings.Points;
            label2.Text     = Settings.Score.ToString(); //id ekéne lekérni majd a pontot
            generateFood();
        }
Esempio n. 2
0
        private void startGame()
        {
            label3.Visible = false;
            new Settings();
            Snake.Clear();
            SnakePart head = new SnakePart {
                X = 10, Y = 5
            };

            Snake.Add(head);
            for (int i = 0; i < 5; i++)
            {
                SnakePart body = new SnakePart {
                    X = 9 - i, Y = 5
                };
                Snake.Add(body);
            }
            label2.Text = Settings.Score.ToString();
            generateFood();
        }