Sub tmBall_Tick
...
'check collision ball and pad
'1. check collision ball and players pad
If (imgBall.Top<=pnlPlayer.Top+pnlPlayer.Height) AND (imgBall.Left>=pnlPlayer.Left-imgBall.Width-1 AND imgBall.Left<=pnlPlayer.Left+pnlPlayer.Width+1) Then
collision(pnlPlayer) [COLOR="Green"]'we call the sub with the name of the pad[/COLOR]
End If
'2. check collision ball and computers pad
If (imgBall.Top+imgBall.Height>=pnlComputer.Top) AND (imgBall.Left>=pnlComputer.Left-imgBall.Width-1 AND imgBall.Left<=pnlComputer.Left+pnlComputer.Width+1) Then
collision(pnlComputer)
End If
...
End Sub