private void checkInput(long elapsedTime) {

        if (exit.isPressed()) {
            stop();
        }

        Player player = (Player)map.getPlayer();
        if (player.isAlive()) {
            float velocityX = 0;
            if (moveLeft.isPressed()) {
               
                velocityX-=player.getMaxSpeed();
            }
            if (moveRight.isPressed()) {
               
                velocityX+=player.getMaxSpeed();
            }
            if (jump.isPressed()) {
               
                player.jump(false);
            }
            player.setVelocityX(velocityX);
        }

    }