コード例 #1
0
        public void CurrentTetrominoMovRight()
        {
            Point position = currentTetromino.GetCurrentPosition();

            Point[] shape = currentTetromino.GetCurrentShape();
            bool    move  = true;

            CurrentTetrominoErase();

            foreach (Point S in shape)
            {
                if (((int)(S.X + position.X) + ((cols / 2) - 1) + 1) >= cols)
                {
                    move = false;
                }
                else if (blockControls[((int)(S.X + position.X) + ((cols / 2) - 1) + 1),
                                       (int)(S.Y + position.Y) + 2].Background != noBrush)
                {
                    move = false;
                }
            }

            if (move)
            {
                currentTetromino.MovRight();
                CurrentTetroMinoDraw();
            }
            else
            {
                CurrentTetroMinoDraw();
            }
        }