コード例 #1
0
        public void CurrentTetrominoMovLeft()
        {
            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) < 0)
                {
                    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.MovLeft();
                CurrentTetroMinoDraw();
            }
            else
            {
                CurrentTetroMinoDraw();
            }
        }