So basically, I am doing my first xna game and it’s an arkanoid game. My ball right now is a square that rotate.
Unfortunately, it’s impossible to correctly detect the collision of a rotated rectangle in xna.
I found thing about scalars but I am only in computer science in college so I don’t know about these big maths…
Can anyone direct me in the right way to detect these kind of collision ? or at least to be able to obtain a new rectangle in the right way so that I can detect the collision on this one?
EDIT
I just thought about making my rotating square in a still square and test the collision with the outer square would that be viable ?
If you want to detect a collision of the square ball with the outer rectangle, you need to know the coordinates of the four corners of the ball. Then simply compare these points with the outer rectangle.
If
sis the length of the sides of the rectangle. The corners can be calculated like this: