コード例 #1
0
        public SnakeWindowsFormClient()
        {
            InitializeComponent();

            engino = new Engine()
            {
                Height = (int)nudHeight.Value, Width = (int)nudWidth.Value
            };
            engino.OnGameOver      += Engino_OnGameOver;
            engino.OnSnakeEatApple += Engino_OnSnakeEatApple;
            engino.SetupNewGame();


            timer          = new Timer();
            timer.Tick    += T_Tick;
            timer.Interval = 1000;

            updateTheCalculater();

            btnStart_Click(btnStart, null);
            btnStart_Click(btnStart, null);
            btnStart_Click(btnStart, null);
        }
コード例 #2
0
 private void btnNewGame_Click(object sender, EventArgs e)
 {
     engino.SetupNewGame();
     getGameStatus();
 }