I recommend API if you're comfortable with it.
There is a command IntersectRect that can be called. This is very fast and very effective.
VB Code:
Declare Function IntersectRect Lib "user32" Alias "IntersectRect" _
(lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Long
Type RECT
Left as Long
Top as Long
Right as Long
Bottom as Long
End Type
Now use a line similar to this to see if the two intersect:
VB Code:
If IntersectRect(TEMPRECT, BALLRECT, PADDLERECT) <> 0 Then
'RUN COLLISION CODE
End If
You must declare all those varible in the finction call as RECT. And to set values to both the ball and the paddle you do something like this:
VB Code:
With BALLRECT
.Left = 50
.Right = .Left + 10
.Top = 50
.Bottom = .Top + 10 'HEIGHT OF BALL
End With
With PADDLERECT
.Left = 150
.Right = .Left + 100 'WIDTH OF PADDLE
.Top = 50
.Bottom = .Top + 50
End With
All those numbers are of coarse arbitrary, so do what you must. This explanation is pretty over simplified, but if you have any questions ask'em away!
NOMAD