Это только кусок кода (рабочий).
- Код: Выделить всё
Dim i As Integer
Dim fin_x As Integer
Dim fin_y As Integer
Dim am_x, am_y As Integer
Private Sub Command1_Click()
fin_x = Food.Left
fin_y = Food.Top
am_x = Shape1.Left
am_y = Shape1.Top
If fin_x < Shape1.Left And fin_y < Shape1.Top Then
[color=red]For am_x = Shape1.Left To am_x = fin_x[/color]
cmnd_leftup
Next am_x
Else
[color=red]End If[/color]
End Sub
Private Sub cmnd_leftup()
i = 1
For i = 1 To 51
i = i + 1
Shape1.Left = Shape1.Left - 2
Shape1.Top = Shape1.Top - 2
Next i
End Sub