Here is a video of the result:
http://4storing.com/joityt/b80e71eb6...1739ad7a8.html
And here is the code:
Code:
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True '~~~> Enable the timer
Timer1.Interval = 10 '~~~> Speed
End Sub
Private Sub Timer1_Timer()
If Picture2.Left < (Picture1.Left - Picture1.Width - 150) Then
Picture2.Left = Picture2.Left + 100
Else
'// when it reaches the enemy, attack
Timer1.Interval = 100
num = num + 1
Picture2.Picture = imgfire2(num)
If num = 22 Then
Timer1.Enabled = False
Picture2.Left = 360
Picture2.Picture = Image2.Picture
End If
End If
End Sub
And one more think I want evry time i click Command1 the animation repeat again and again and again.
But have problem when click one time evrythink perfect ot the second one don't work where can be the problem.
P.P:To resolve this problem just add num = 0 after Timer1.Enabled = False.
P.P2:akhileshbc If you can make the naruto sprite of the video move in the real way please post the code ofcourse use the above code please.
Thanks to all who help.