Collision Between Two Squares
- Much less math here.
- We can make a geometrical argument
- Is any corner of one square "inside" the other square.
- If so, we have a collision.
- But this is not quite enough
- We have the condition where two squares form a + sign.
- Then we need to check if the top or bottom edges of first square is between the top and bottom edges of the second square
- AND if the left or right edges of the second square are between the left and right edges of the first square.
- For a collision test, I just built a bounding box around the circle.
Take a look a Bounding Box demo