A square tile collides with another square tile. The bartender says...
I have:
Given r1 and r2 (r2 being stationary), first find the closest corner of r2 to r1. This point is (c1.x,c1.y) and imagine now you extend this out into two planes, one parallel to the x axis and one to the y.
Now get the closest corner of r1 to r2 (call it c2) and use it in the following formula y = mx + b where b is c2.x and m is your vector. and x is c1.x
So if y is greater than c1.y then it means at the point of x contact (width) you've already hit the top. If it's less, then you haven't hit it yet. Invert for bottom/top.