/// <summary> /* * TetrisBoard::newBlock() * * NAME * * TetrisBoard::newBlock - Sets newblock to current block * and then makes a new next block. * * SYNOPSIS * * void TetrisBoard::newBlock(); * * * DESCRIPTION * * This function changes the next block to the current * block. Then, the functions creates a new next block. * * AUTHOR * * Janila Khan * * DATE * * 9:00pm 3/11/2018 * */ /// </summary> public void newBlock() { if (!gameOver()) { m_currentBlock = m_nextBlock.centerPosition(); m_nextBlock = new TetrisBlocks(this); } }
/// <summary> /* * TetrisBoard::TetrisBoard() * * NAME * * TetrisBoard::TetrisBoard - Constructor * * SYNOPSIS * * TetrisBoard::TetrisBoard(); * * * DESCRIPTION * * Constructor * * AUTHOR * * Janila Khan * * DATE * * 11:00pm 3/11/2018 * */ /// </summary> public TetrisBoard() { // Intialize the board m_board = new Rectangle[cols, rows]; m_color = new SolidBrush[cols, rows]; m_level = 1; m_score = 0; m_rowsCleared = 0; // Create and call for block piece m_currentBlock = new TetrisBlocks(this); m_currentBlock.centerPosition(); m_nextBlock = new TetrisBlocks(this); }