Quote: "thanks! i figured it would be something simple like that"
I don't think it is actually.
For a start, unless DBP has changed from DBC, (I haven't had chance to test it yet), I'm pretty sure that you can't negate variables like that. If it doesn't work, try
vx = 0-vx.
But, the main thing is that code only reverses the direction on the X direction. It doesn't alter the angle based on the point of impact - or the speed of the paddle which is an aspect which
could also be factored in.
If the paddle is on the right and moves up/down, then the ball will be moving from left to right on impact.
Normally you would negate the X value as shown by Code Dragon and leave the Y value alone - and the bounce angle remains unchanged.
Altering the Y value would be needed to alter the angle.
If it hits the paddle dead in the middle then you might decide to have no Y velocity when the ball is returned. You might also want it to be that the further from the centre of the paddle is hit, the sharper the bounce angle.
To do this, divide the paddle into say 5 zones. This is easier if you make each zone say 10 pixels and have the paddle 50 pixels in size.
At the moment of impact, you know the Y position of the ball. You also know the Y position of the paddle and can calculate it's Y centre.
If the ball's Y position is greater than the centre of the paddle minus 5 and less than the centre of the paddle plus 5 then the ball just hit the centre zone. If so, negate the X and set the Y to zero. Something along the lines of:
If BallPosY > PaddleCentreY-5 and BallPosY < PaddleCentreY+5
Rem Centre Zone
vx = 0-vx
vy = 0
Endif
All you need to do is calculate which zone of the paddle was hit using the same method and alter the Y value accordingly.
TDK_Man