这是我的碰撞方法,但它只是在相反的方向反弹。
'Collision Method 1
Dim Col As Boolean = Collision(pxbox, pbpaddle1)
If Col = True Then
moveRight = Not moveRight
moveDown = Not moveDown
End If
Dim Col2 As Boolean = Collision(pxbox, pbpaddle2)
If Col2 = True Then
moveRight = Not moveRight
moveDown = Not moveDown
End If
这是我的碰撞功能
Private Function Collision(ByVal P1 As PictureBox, ByVal P2 As PictureBox) As Boolean
If P1.Left + P1.Width < P2.Left Then Return False
If P2.Left + P2.Width < P1.Left Then Return False
If P1.Top + P1.Height < P2.Top Then Return False
If P2.Top + P2.Height < P1.Top Then Return False
Return True
End Function
答案 0 :(得分:0)
有一些问题。