MisanthropicBit / terminal_blocks

A Tetris clone you can play in your terminal
MIT License
0 stars 0 forks source link

Fix block final positions when clearing #9

Closed MisanthropicBit closed 5 years ago

MisanthropicBit commented 5 years ago

There are still some blocks that are not being moved correctly when blocks are cleared. Instead, they are left hanging in the air. This appears to happen mostly to the upper-most layer of blocks suggesting an off-by-one error.

MisanthropicBit commented 5 years ago

Turns out this was caused by not clearing (zeroing out) the old lines that were moved down. All lines except the last non-empty line were being overwritten by the line above them. Strictly speaking, it would be enough just to clear the last non-empty line.

Fixed in c27e0b6878721d92e5cc23ba6ce2ccb5cb796f8e.