MinecraftU / 2021-computer-adventures

Repository for our 2021 Computer Adventures Ruby project!
0 stars 0 forks source link

Remove filled rows #40

Closed jamespeilunli closed 3 years ago

jamespeilunli commented 3 years ago

closes #31 closes #39

A filled row is one not consisting of zeros. In other words, a filled row is completely filled with squares.

2 methods have been added to Game in game.rb.

  1. remove_filled_rows, which goes through each row, checks if it's filled, and sets that row to zeros, along with all filled rows above it.
  2. move_all_down moves everything above a certain row down one row. This is to fill in the line(s) of zeros created by remove_filled_rows. move_all_down is called inside remove_filled_rows.

These changes remove filled rows at any position on the gameboard, not just the last row. They also remove multiple filled rows in one tick.

jamespeilunli commented 3 years ago

i had some test code so i didn't have to create an almost filled row by myself; now removed

dealingwith commented 3 years ago

Genius!