First off, everyone here at deviantART would like to say THANK YOU!!!
We have received an overwhelming amount of enthusiasm for the launch of version 6 and believe that this has been our best-received launch to date.
|
' SWITCH TO LEFT AND MOVE DOWN
If imgInvaders4(farright).Left + 735 >= formright Then
dx3 = dx3 * -1
For X2 = 0 To 13
imgInvaders4(X2).Top = imgInvaders4(X2).Top + dy
Next X2
End If
' FAR LEFT AND FAR RIGHT INVADERS, it is often bad practice: some languages just set the bounds before first loop and won't change, others will take the new bound in account, other will become crazy... You can probably put this test outside of the loop since it doesn't rely on X anyway.For X2 = 0 To 13 you forgot to use your variables. There is also a raw 115 in the code.
So far, I have Farleft = 0 and FarRight = 13.
For X = farleft To farright
' FAR LEFT AND FAR RIGHT INVADERS
If imgInvaders4(farleft).Visible = False Then
farleft = farleft + 1
End If
If imgInvaders4(farright).Visible = False Then
farright = farright - 1
End If
' MOVEMENT
imgInvaders4(X).Left = imgInvaders4(X).Left + dx3
' SWITCH TO RIGHT AND MOVE DOWN
If imgInvaders4(farleft).Left <= FrmMain.ScaleLeft Then
dx3 = dx3 * -1
For X2 = farleft To farright
imgInvaders4(X2).Top = imgInvaders4(X2).Top + dy
Next X2
imgInvaders4(0).Left = imgInvaders4(0).Left + 115
End If
' SWITCH TO LEFT AND MOVE DOWN
If imgInvaders4(farright).Left + 735 >= formright Then
dx3 = dx3 * -1
For X2 = 0 To 13
imgInvaders4(X2).Top = imgInvaders4(X2).Top + dy
Next X2
End If
' REACHING THE BOTTOM
If imgInvaders4(X).Top + 735 >= formbottom Then
endfail = MsgBox("They've invaded the planet and you are at fault. You shall be smited by Xenu.", vbOKOnly, "You fail")
End
End If
Next X
My problem is that when they reach the edge of the form, then they just take a shit and fall straight down rather than move down dy (100) and switch direction.
Any reason why it's messing up?
--
Life is a waterfall, we're one in the river and one again after the fall.