@Override public synchronized void player1PushDown() { if (gamePaused || !gameStarted) { return; } try { restartPlayer1GameTimer(); if (board.getTetrisModel().getFigure1().pushDown() == AbstractFigure.RESULT_FREEZED) { updatePlayer1ScoreViewer(board.getTetrisModel().removeRows()); board.getTetrisModel().getFigureManager1().pregenerateFigure(); /* * Put preview figure */ board.getPlayer1PreviewerModel().clear(); board .getTetrisModel() .getFigureManager1() .getNextFigure() .putFigure(board.getPlayer1PreviewerModel(), 4, 0); repaintPlayer1Previewer(); /* * Put new figure */ final AbstractFigure figure = board.getTetrisModel().getFigureManager1().getCurrentFigure(); board.getTetrisModel().setFigure1(figure); if (!figure.putFigure(board.getTetrisModel(), 4, 0)) { gameOver(); } else { board.getDownShifter().doShift(); networkManager.sendCommand(DoShiftCommand.class); } } updatePlayer1ScoreViewer(1); repaintDownShifter(); } catch (IOException ex) { interraptGame(ex); } }
public void doShift() { board.getDownShifter().doShift(); }