Collision Detection Function
A small function to detect collision between 2 objects!
Rate Collision Detection Function
(3(3 Vote))
Function IsCollide(Object1 As Object, Object2 As Object) As Boolean
Dim Ob1 As Object
Dim Ob2 As Object
Set Ob1 = Object1
Set Ob2 = Object2
If Ob1.Left < Ob2.Left + Ob2.Width And Ob1.Left + Ob1.Width > Ob2.Left And Ob1.Top < Ob2.Top + Ob2.Height And Ob1.Top + Ob1.Height > Ob2.Top Then
IsCollide = True
Else
IsCollide = False
End If
End Function
Please provide some feedback about this post.
Collision Detection Function Comments
No comments yet — be the first to post one!
Post a Comment