Hi,
When the ball hits the paddle in a Breakout clone how do I calculate the bounce angle?
We have a pad, say it’s 180 wide, and when the ball bounces on the left side ( less than 90 degrees) it should bounce left but with a certain angle and if it hits the right side (more than 90 degrees) it should go right with a certain angle.
The program is built so that I have a velocity for both the X and Y axis so how do I calculate the new X and Y values when the ball hits a specific point on the paddle?
If it hits pixel 45 it should get a new X value, -1, and a new Y value, 1. but how do I calculate both the new X and new Y value?
Thanks in advance for helping me with this, reference to other material is very appreciated aswell!
Best regards,
Tomas