@Override public void serveKeyReleased(int keyCode) { MultiplayerGame game = (MultiplayerGame) model.getGame(); Player opponent = game.getOpponent(); checkIfStop(keyCode, opponent); }
@Override public void serveKeyPressed(int keyCode) { MultiplayerGame game = (MultiplayerGame) model.getGame(); Player opponent = game.getOpponent(); if (keyCode == Input.KEY_ESCAPE) { if (!game.isGameOver()) { game.setGameOver(true); game.setPlayerWon(true); } } else if (keyCode == Input.KEY_SPACE) { game.plantBomb(opponent); } else { checkIfMove(keyCode, opponent); } }