I've searched this message board for a couple days and still don't get how the IntersectRect API works. I'm doing some simple rectangular collison detection and I don't understand the parameters of the API:
Declare Function IntersectRect Lib "user32" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Long
What does the Destination Rectangle do/look like?
I've defined RECT (TOP,BOTTOM,LEFT,RIGHT as long) as a type, is that right?
Here is all my object collision code:
TempRect is a dummy varible, it has no value unless IntersectRect gives it to it.Code:Dim TempRect as RECT
If IntersectRect(TempRect, BLOCKS(i).POINTS, BALLS(j).POINTS) <> 0 And BLOCKS(i).HIT > 0 Then
.POINTS are defined as RECT...
The ball just passes through the block, never "hitting" them.
Anyone know what's wrong?
