I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this:
// Ball class rectangle.Intersects(paddle.Rectangle);
Is there any way I can get the exact coordinates of the collision, or any details about it, with the current
I thought of doing some basic calculations, such as comparing the exact coordinates of each object on the moment of the collision. It would look something like this:
// Ball class if((rectangle.X - paddle.Rectangle.X) < (paddle.Rectangle.Width / 2)) // Collision happened on the left side else // Collision happened on the right side
But I'm not sure this is the correct way to do it.
Do you guys have any tips on maybe an engine I might have to use to achieve that? Or even good coding practices using this method?