Click to See Complete Forum and Search --> : Image moved with timer is screwed up. Help
RenegadeMike
Jan 25th, 2000, 10:43 PM
I am trying to move an Image with a timer. The timer's interval is set to 50 and it moves the image 5 pixels to the right. After a while of moving it something strange happens. Instead of it moving 5 to the right, 5 to the right, 5 to the right, etc. it moves 4 or 6 to the right. The the image's left property is sometimes 159 and 176 etc. This is a bit odd. Does anyone know what's going on and how to fix it? Thanx.
chrisjk
Jan 26th, 2000, 04:33 AM
Enclose code in the code tag which I cannot type otherwise it will think i'm writing code! If [ is <, then the code tag is <code>your code here</code>
joey o.
Jan 26th, 2000, 11:00 AM
If you have globals check them against your local variables (if your not declaring). Post the code. It could be a couple of things like the initialization of your variable in a For statement which might waver between 0 + 1, or the timer beginning again when a for ending statement is reached.
RenegadeMike
Jan 26th, 2000, 11:15 AM
Private Sub Timer3_Timer()
MM 3
Label1 = Worm(0).Left + (Worm(0).Width - 1) 'to check the left property
If Timer1 = False Then Timer1 = True
If Worm(0).Left >= 0 Then
If fast = 0 Then
Worm(0).Move Worm(0).Left - 5
Else
Worm(0).Move Worm(0).Left - 15
End If
End If
End Sub
RenegadeMike
Jan 26th, 2000, 11:16 AM
how come my code here isn't formatted?
RenegadeMike
Jan 26th, 2000, 11:47 AM
I figured out how to fix it but I still don't know why that was happening.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.