I have two rectangles, the red rectangle (can move) and the blue rectangle. Both have: x, y, width, height.
How can I say in a programming language such as Java when
calculate 4 points of second rectangle. Note them as pointE, F, G H.
Iterate point E,F,G,H (1) if any of these is within area that A,B,C,D enclosed. return collision. (2) otherwise no collision.
For 3.(1) algorithm. you need something like this.
Xe >= Xa && Xc <= Xb. && Yc >= Yc && Ye <=Yc