Imagine a "player" object that is rotated collides with a "block" object that is not. I am using Area from java's API to detect the collisions so the only information I have is the coordinate of the top left corner of bother rectangles. How can I calculate how much in each direction (x and y) the "player" has to move in-order to no longer be intersecting with the "block".

the red rectangle is the block and and grey rectangle is the player

0 Answers