コード例 #1
0
ファイル: TetrisGame.cs プロジェクト: shuohan/Tetris-se2013
        private void HandleAction()
        {
            if (_controller.Act(GameAction.Rotate))
            {
                _block.Rotate();
                if (Intersect())
                {
                    _block.CounterRotate();
                }
            }

            if (_controller.Act(GameAction.Left))
            {
                _block.RPos--;
                if (Intersect())
                {
                    _block.RPos++;
                }
            }
            if (_controller.Act(GameAction.Right))
            {
                _block.RPos++;
                if (Intersect())
                {
                    _block.RPos--;
                }
            }
        }
コード例 #2
0
ファイル: AIBenchmarks.cs プロジェクト: goeaway/snake-bout
        public bool Completes()
        {
            while (!_controller.Act())
            {
                Thread.Sleep(1);
            }

            return(true);
        }
コード例 #3
0
ファイル: TetrisGame.cs プロジェクト: xvblack/Tetris-se2013
 /// <summary>
 /// 处理暂停
 /// </summary>
 private void HandlePause()
 {
     if (_controller == null)
     {
         return;
     }
     if (_controller.Act(GameAction.Pause))
     {
         this.PauseOrContinue();
     }
 }