|
-
Jun 12th, 2014, 08:35 AM
#1
Thread Starter
New Member
Movement problem
I have a code to move a bunch of arrays that are targets. this is the code
Private Sub Timer1_Timer()
Dim i
For i = 0 To 9
Target(i).Top = Target(i).Top - ((-1) ^ i) * Rnd(1) * speed
Target(i).Left = Target(i).Left - ((-1) ^ i) * Rnd(1) * speed
If Target(i).Top < 0 Or Target(i).Left < 0 Then
Target(i).Top = Me.ScaleHeight
Target(i).Left = Me.ScaleWidth
End If
If Target(i).Top > Me.ScaleHeight Or Target(i).Left > Me.ScaleWidth Then
Target(i).Top = Me.Top
Target(i).Left = Me.Left
End If
Next i
End Sub
But i have 1 problem. Every time the targets move to the top left of the screen, they would come out of the bottom right of the screen, and that is supposed to happen. BUT for some reason, when they go to the bottom right of the screen, they will come out of the top left ( like they should ) but they stay there frozen and flickering? please tell me if you know why.
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|