MinecraftU / 2021-computer-adventures

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

When a tetromino can't fall anymore, create a new tetromino #17

Closed jamespeilunli closed 3 years ago

jamespeilunli commented 3 years ago

Needs a way to send a message to Game that tells it "I can't fall anymore!" so Game can initialize a new tetromino and throw away the old one. An is_dead method may be a good way to do this. Put logic into is_dead method to check if there's anything below it.

We should also let the player move the tetromino before the is_dead method is called, because in cases like this (pretend 2s are tetris blocks in the controlled tetromino, 1s are other tetris blocks, and 0s is empty space):

[[... 0, 0, 0, 2, 2, 2, 1, 0, ...],
[...  0, 0, 0, 0, 2, 1, 1, 1, ...],
...]

Even though there is a 1 under a 2, the player can still move left.