这是我的碰撞方法,但它只是朝相反的方向反弹。
'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发布于 2014-03-19 02:07:15
有几个问题。
https://stackoverflow.com/questions/22481653
复制相似问题