help me bout this pls

Kezman
03-27-2001, 05:37 AM
Private Sub tmrEnemy_Timer()
If Start = 1 Then
imgEnemy.Left = imgEnemy.Left + 100 * Rnd
If imgEnemy.Left >= 6350 Then
imgEnemy.Left = 6350
End If
If imgEnemy.Left = 6350 Then
tmrEnemy.Enabled = False
tmrEnemy2.Enabled = True
End If
End If
End Sub

Private Sub tmrEnemy2_Timer()
If Start = 1 Then
imgEnemy.Left = imgEnemy.Left - 100 * Rnd
If imgEnemy.Left <= 75 Then
imgEnemy.Left = 75
End If
If imgEnemy.Left = 75 Then
tmrEnemy2.Enabled = False
tmrEnemy.Enabled = True
End If
End If
End Sub

i am trying to make it so that
when the object reaches 6350 (left)
it will start to move back to 0 (left) again
im new to VB so im not pretty sure how to do it....
the code above did not work

Ad1
03-27-2001, 06:55 AM
your code will work if your timers intervals are not set to 0, and if timer2 is disabled to start and timer1 is enabled

Ad1
03-27-2001, 07:04 AM
Alternatively try this

<pre>
dim x as integer
x=100

Private Sub timer1_timer()

if start=1 then
imgenemy.Left = imgenemy.Left - x* Rnd
if imgenemy.left>=6350 or imgenemy.left<=75 then
x=x*-1
endif
endif

end sub</pre>
it will make your life simpler

Kezman
03-27-2001, 05:23 PM
okay......
thank you pal!!
:)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum