Hey, so I'm making a Breakout game in C++ w/ DirectX, and I'm having some trouble thinking of the ball bouncing physics. The way I've made breakout games before was to have the ball only move at 45 degree angles. This was fairly simple. Just reverse the x or y movement everytime you hit something. But now I want to make a game where the ball moves not just at 45 degree angles. The way I see it, bouncing against non-moving blocks will not change the direction that the ball is moving (that is angle-wise, obviously it will bounce off, but the angle that the ball is moving won't ever change to anything other than 45, 135, 225, or 315 degrees. So I came to the conclusion that the only way to change the angle is when the ball collides with a moving object, i.e., the paddle. But I'm not sure how this works exactly. How do I calculate the change in angle based on the movement of the paddle, the place the ball hits the paddle, and the angle the ball is currently traveling at. I look online for some tips but I couldn't find much that gave an algorithm and explained it. So anyone have what I'm looking for. How do I use the factors I just mentioned along with any others I might need to take into consideration to write the code for this?
Any and all help is appreciated. :)