public void update(long delta){
        if (rightPressed && checkBeatOutOfBounds() != 1){
            beat.move((int)delta);
        }
        if (leftPressed && checkBeatOutOfBounds() != 0){
            beat.move(-(int)delta);
        }
        ball.move((int)delta);
        resolveBallCollision();
        checkWinCase();
    }