Esempio n. 1
0
        public void CurrentTetrominoMovDown()
        {
            Point position = currentTetromino.GetCurrentPosition();

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

            CurrentTetrominoErase();


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

            if (move)
            {
                currentTetromino.MovDown();
                CurrentTetroMinoDraw();
            }
            else
            {
                CurrentTetroMinoDraw();
                CheckRow();
                currentTetromino = new TetroMino();
            }
        }