some general pseudocode:
where x = horizontal motion, start at 1
y = vertical motion, start at 1
b = ball's screen position, start at left middle
ball loop
b = x + y
if then y = (-y)
if then x = (-x)
end loop
---
You can get fancier by "segmenting" each paddle and modifying x and y by more than 1 when it hits "extremes" of the paddle. If you start the ball motion variables out at 2 and 2, you can do this
if
then if then x = (-x)
else if then x = (-x) and y = (-y) and
else if then x = (-x) and
----
Where "near edge" and "far edge" pertains to whether the motion of the ball is coming from the top or the bottom. This way the ball's vertical motion can keep getting faster depending on where you hit it. Also, you can reverse the motion of the ball and slow it a bit by hitting it with the facing edge of your paddle, "throw a curve" so to speak.
-------------------------