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):
Needs a way to send a message to
Game
that tells it "I can't fall anymore!" soGame
can initialize a new tetromino and throw away the old one. Anis_dead
method may be a good way to do this. Put logic intois_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):Even though there is a 1 under a 2, the player can still move left.