|
-
Oct 26th, 2001, 01:39 PM
#1
IntersectRect?
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:
Code:
Dim TempRect as RECT
If IntersectRect(TempRect, BLOCKS(i).POINTS, BALLS(j).POINTS) <> 0 And BLOCKS(i).HIT > 0 Then
TempRect is a dummy varible, it has no value unless IntersectRect gives it to it.
.POINTS are defined as RECT...
The ball just passes through the block, never "hitting" them.
Anyone know what's wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|