CaptainCool
09-07-2003, 11:03 AM
I have a picture of a car that I want to move back and forth on the screen constantly. here is the code I have so far.
Private Sub tmrTimer1_Timer()
If imgCar.Left > 5000 And blnLeft Then
imgCar.Left = imgCar.Left - 75
ElseIf imgCar.Left < 75 Then
blnLeft = False
blnRight = True
ElseIf imgCar.Left < 8000 And blnRight Then
imgCar.Left = imgCar.Left + 75
ElseIf imgCar.Left > 8000 Then
blnRight = False
blnLeft = True
imgCar.Left = imgCar.Left - 75
End If
End Sub
This makes the car go left but then it stops and doesn't go back to the right.
Any one know how I could fix this?
thanks and advanced!
Private Sub tmrTimer1_Timer()
If imgCar.Left > 5000 And blnLeft Then
imgCar.Left = imgCar.Left - 75
ElseIf imgCar.Left < 75 Then
blnLeft = False
blnRight = True
ElseIf imgCar.Left < 8000 And blnRight Then
imgCar.Left = imgCar.Left + 75
ElseIf imgCar.Left > 8000 Then
blnRight = False
blnLeft = True
imgCar.Left = imgCar.Left - 75
End If
End Sub
This makes the car go left but then it stops and doesn't go back to the right.
Any one know how I could fix this?
thanks and advanced!