20.1.1 CheckLoss

A method you can develop without difficulty is checkLoss. This method should check whether the player has lost the game. When should that happen? When a new block appears at the top and that block cannot be moved down, the player has lost. And when is it impossible to move a block down. And when it would collide with the Pile.

Pile already has a method collides. You can pass the object currentBlock and the desired direction to that method. If the method returns false, you can call Score.gameIsLost().