コード例 #1
0
ファイル: Snake.cs プロジェクト: pavelilchev/Snake
        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
ファイル: Snake.cs プロジェクト: pavelilchev/Snake
        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();
        }