@Override
    public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
        if (container.getInput().isKeyPressed(Input.KEY_ESCAPE) || container.getInput().isKeyPressed(Input.KEY_BACK)) {
            game.enterState(0);
        }
        switch (board.state) {
        case RUNNING:
            if (container.getInput().isKeyPressed(Input.KEY_SPACE)) {
                board.state = Board.BoardState.PAUSED;
                update(container, game, delta);
            }
            updatePlayer(container, game, delta, board.player1, Input.KEY_W, Input.KEY_A, Input.KEY_S, Input.KEY_D,
                    Input.KEY_T, Input.KEY_Y);
            updatePlayer(container, game, delta, board.player2, Input.KEY_UP, Input.KEY_LEFT, Input.KEY_DOWN,
                    Input.KEY_RIGHT, Input.KEY_COMMA, Input.KEY_PERIOD);
            break;
        case PAUSED:
            if (container.getInput().isKeyPressed(Input.KEY_SPACE)) {
                board.state = Board.BoardState.RUNNING;
                update(container, game, delta);
            }
        case DONE:
            if (container.getInput().isKeyPressed(Input.KEY_SPACE)) {
                game.enterState(1);
            }
        }
    }