Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.38 KB | None | 0 0
  1.     Public Function Collision(ByVal Object1 As Control, ByVal Object2 As Control) As Boolean
  2.         Dim sx, sy As Boolean
  3.         sx = Object1.Left <= (Object2.Left + Object2.Width) And (Object1.Left + Object1.Width) >= Object2.Left
  4.         sy = (Object1.Top + Object1.Height) >= Object2.Top And Object1.Top <= (Object2.Top + Object2.Height)
  5.         Collision = sx And sy
  6.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement