Example #1
0
        // Add a random row to this GameBoard
        public void AddRow()
        {
            // Flag the bottom row as active, if present
            if (gameBoard.Rows > 0)
            {
                for (var i = 0; i < gameBoard.Columns; i++)
                {
                    gameBoard[0][i].IsActive = true;
                }
            }

            // Get a new random row
            Block[] randomRow = GetRandomRow();

            // Insert into position 0 on both the rows and columns (its just easier this way)
            gameBoard.AddAbove(randomRow);
            // #TODO: Increase speed/game level

            // Player needs updating when a row is added too
            player.OnRowAdded();
        }