Posted: Mon May 17, 2010 7:39 pm Post subject: Bounce and check bounce issues
I'm trying to make a pong game on Turing for school. I have major issues with wall bounces and paddle bounce detection issues.
Please enable air hockey mode to get these bugs to appear.
WSAD to move first paddle, arrow keys for the second paddle.
I'm trying to get the ball to bounce off walls for 0<y<150 and 250<y<400
The paddle issue is when you move the paddle forward to push the ball, it sometimes make the ball go backwards. I know why it happens, because each movement moves the paddle 5 pixels, and the ball may only move 1-2 pixels at a direction every time it moves. So it creates a "teleporting" effect, where the paddle is suddenly behind the ball. I don't know how to fix it without making the paddle move very slowly (1 pixel at a time).
I have NO idea why the wall bounce detection doesn't work. The code seems perfect.