I've got a wall in my 2-D game. I've got everything except the not-allowing-you-into the wall part. I know I can use the intersect method on some Rectangles to know if they intersect, but I need to know where they intersect so that I can kick them out when they come into the rectangle.

I'm stumped, anyone got a way to do this?

the problem is here:

-----------

| |

| |

-----------

-------

| |

| |

| |

-------

(Those two boxes intersect, and they're as wide as the top parts. The formatting on this site won't allow me to add the extra spaces for some reason). The problem is:

I can detect if one x is greater than the other, and that tells me one side, but what if it's both above, and to the side? I can't think of a way to tell me this.

Thanks,

Jack

P.S. Now that I re-read that, its slightly confusing... please ask me if you don't understand. Thanks!