Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function Collision(ByVal Object1 As Control, ByVal Object2 As Control) As Boolean
- Dim sx, sy As Boolean
- sx = Object1.Left <= (Object2.Left + Object2.Width) And (Object1.Left + Object1.Width) >= Object2.Left
- sy = (Object1.Top + Object1.Height) >= Object2.Top And Object1.Top <= (Object2.Top + Object2.Height)
- Collision = sx And sy
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement