I would like to make an Air Hockey game in pygame.
I was wondering if it was possible to have 'proper' bouncing (ie. the puck goes in a direction relative to the angle the paddle hit it in).
I can easily write the rest of the code.
You must add the paddle's momentary velocity to the pucks velocity*-1 in a vectorial way.
That means if the paddle is not moving, then the velocity of the puck after the hit is -1*velocity before the hit. As expected.
If you have the velocity vector you have the angle of it.
If the puck comes in with the velocity vector (-1,-2), and the paddle is moving with (3,4), then the velocity vector of the puck will be -1*(-1,-2)+(3,4)==(4,6)
The angle of (4,6) is arcus tangent (6/4), or any other arcus trigonometric function can be used.