Vba 标签(预)与标签碰撞

Vba 标签(预)与标签碰撞,vba,label,collision-detection,point,Vba,Label,Collision Detection,Point,我在做一些游戏,斯图夫,我在做碰撞测试。 我要做的是检查coordenate是否为空,以便玩家可以移动。 这是我到目前为止所拥有的,但它不起作用 Function ColissionWithPoint(ByVal Lbl1 As Label, ByVal Lbl2 As Label) As Boolean Dim pUp As New Point(Lbl1.Location.X - 1) Dim pDown As New Point(Lbl1.Location.X + Lbl1.

我在做一些游戏,斯图夫,我在做碰撞测试。 我要做的是检查coordenate是否为空,以便玩家可以移动。 这是我到目前为止所拥有的,但它不起作用

Function ColissionWithPoint(ByVal Lbl1 As Label, ByVal Lbl2 As Label) As Boolean
    Dim pUp As New Point(Lbl1.Location.X - 1)
    Dim pDown As New Point(Lbl1.Location.X + Lbl1.Height + 1)
    Dim pLeft As New Point(Lbl1.Location.Y - 1)
    Dim pRight As New Point(Lbl1.Location.Y + Lbl1.Width + 1)
    If pDown.Equals(Lbl2.Bounds) Or pUp.Equals(Lbl2.Bounds) Or pLeft.Equals(Lbl2.Bounds) Or pRight.Equals(Lbl2.Bounds) Then
        Return True
    Else
        Return False
    End If
End Function