示例#1
0
        public Snake()
        {
            this.InitializeComponent();
            var settings = new Settings();

            this.gameTimer.Interval = 1000 / Settings.Speed;
            this.gameTimer.Tick += this.UpdateScreen;
            this.gameTimer.Start();

            this.StartGame();
        }
示例#2
0
        private void StartGame()
        {
            var settings = new Settings();
            this.lblGameOver.Visible = false;

            this.snake.Clear();

            Circle head = new Circle(10, 5);
            this.snake.Add(head);

            this.lblScore.Text = Settings.Score.ToString();

            this.GenerateFood();
        }