Irene is right to suggest what she did, but that's not your problem. Your code is detecting a collision between the ball and the score. When it detects the collision, it removes the object, which happens to be the score. Also, since the ball starts out in the same position as the score (maybe a poor design choice in itself) and hides it, the collision is ...
You could call the initScoreboard() function to create the new GLabel, like this:
GLabel final = initScoreboard(window);
setLabel(final, "Sorry, you lost!");
setLabel(final, "You win! You cleared all bricks!");
setLocation(final, (WIDTH - ...
Probably the ball hits a brick, the velocity on the y-axis gets inverted and the ball goes down, the ball hits another nearby brick, the velocity on the y-axis gets inverted again and the ball goes up again and so on.
I imagine the fix could be a bit difficult to implement but feel free to try! My suggestion is to implement something as follows:
1. if the ...