Exemple #1
0
        public void Step()
        {
            if (m_Piece == null)
            {
                Random           r      = new Random();
                TetrisPieceColor eColor = ( TetrisPieceColor)r.Next((int)TetrisPieceColor.Red, (int)TetrisPieceColor.Blue);
                m_Piece = new TetrisPiece(this, eColor);
            }
            else
            {
                if (!m_Piece.Step())
                {
                    //Add to board
                    m_Piece.ApplyYourSelfToBoard();
                    m_Piece = null;

                    //Check Rows to see if can clear anything
                    DoClearRowCheck();
                }
            }
        }
        public void Step()
        {
            if( m_Piece == null )
             {
            Random r = new Random();
            TetrisPieceColor eColor = ( TetrisPieceColor)r.Next((int)TetrisPieceColor.Red, (int)TetrisPieceColor.Blue );
            m_Piece = new TetrisPiece(this, eColor);
             }
             else
             {
            if( !m_Piece.Step() )
            {
               //Add to board
               m_Piece.ApplyYourSelfToBoard();
               m_Piece = null;

               //Check Rows to see if can clear anything
               DoClearRowCheck();
            }
             }
        }