Blocks over the Cleared Line Will Fall Down

  1. After you clear a row (as you did in the previous homework), the row looks empty, so all remaining blocks above it will "fall down".
  2. For a cell to "fall down", you may simply increase its y coordinate, and draw it at the new location. You can do this by copying upper rows to lower rows). Don't forget to update the array occupied[][] accordingly.
    String sp("  ");
        for (j=0; j<nWidth; j++)
        {
            color = occupied[i+drop][j] = occupied[i][j];
            sp.show(i, 2*j, color);
        }
    
    

    WHITE BLACK CLEAR
  3. If only one row is cleared, the y coordinates of cells are only incremented by 1.
    If two rows are cleared, the y coordinates of cells are incremented by 2.
  4. Please note that the two cleared rows may not be consecutive. For example, it is possible that row 16 and row 18 are cleared, but row 17 remains.
  5. Now you can add some rules to accumulate points to make this like a real TETRIS game. For example,
    1. When each tetromino touches down, you get 1 point.
    2. Get 10 points when clearing 1 row
    3. Get 40 points when clearing 2 rows simultaneously
    4. Get 90 points when clearing 3 rows simultaneously