efritz/hard-drop

Tetris.update() displays intermittent false game-over conditions

efritz opened this issue · 0 comments

The following lines sometimes uses old data for current, x, and y positions although a new tetromino is placed on the screen. In this condition, the board cannot move the same tetromino to the piece it currently occupies on the board, and a game over is forced.

if (!context.getBoard().canMove(context.getCurrent(), context.getX(), context.getY())) {
    context.setState(State.GAMEOVER);
}