2

The ball gets stuck in the paddle when the paddle hits the side of the ball. I'm not particularly sure how exactly you tried to implement if the ball is moving down move the ball up but my guess is that you probably did something like if (ball collides with paddle AND ball is moving down) { move the ball up } else if (object is GRect) { ...


2

You're on the right track, but there's an additional issue going on. Think of scope this way: a variable only exists within the curly braces that immediately surround it. So, when you declare them outside of the while loop, the variables exist and persist inside of all of main. When you declare them inside the while loop's curly braces, they only exist ...


1

Whoops, sorry guys. Just realized that for the latter situation, when the code goes through the If statement then loops back to the top of the while statement, the velocities get assigned back to their original values, i.e. they won't go negative, while for the former situation allows the velocity to go negative.


1

I think this has to do with your code for detecting collisions. As of now, the only check performed is if a collision with something occurred or not. There is no differentiation between colliding with the paddle, a brick, the wall, etc. Someone else can correct me if I'm wrong, but a label is still an object.


Only top voted, non community-wiki answers of a minimum length are eligible