|
-
Apr 22nd, 2000, 05:28 AM
#1
please help me, i've no clue
hello,
i am making a game where you are a pong like thing that
has to block incoming sticks of dynamite.
i have used timers so far and they are workin all right,
and i put in some code:
------------------------------------------------------------
Private Sub Timer1_Timer()
Enemy.Top = Enemy.Top + 10
If Enemy.Top + Enemy.Height = U.Top Then
If Enemy.Left > U.Left & Enemy.Left < U.Left + U.Width Then
Timer1.Enabled = False
Enemy.Picture = LoadPicture("C:\windows\start menu\programs\graphics\icons\misc\misc14.ico")
End If
End If
If Enemy.Top = 2040 Then
Face.Picture = LoadPicture("C:\windows\start menu\programs\graphics\icons\misc\face04.ico")
Timer1.Enabled = False
Enemy.Picture = LoadPicture("C:\windows\start menu\programs\graphics\icons\misc\misc14.ico")
End If
End Sub
------------------------------------------------------------
but whenever the enemy and you are at the same top distance,
it stops as though you were under it too. any ideas?
thanks
-t_dawolf
-
Apr 23rd, 2000, 05:09 AM
#2
its ok, nevermind
well,
i figured it out so don't bother trying to help. but if you want to know,
i changed the code to:
------------------------------------------------------------
Private Sub Timer1_Timer()
Dim l As Integer
Dim w As Integer
Dim lw As Integer
l = U.Left
w = U.Width
lw = U.Left + U.Width
Enemy.Top = Enemy.Top + 20
If Enemy.Top + Enemy.Height = U.Top And Enemy.Left >= U.Left And Enemy.Left <= U.Left + U.Width Then
Timer1.Enabled = False
------------------------------------------------------------
and then the rest of the code.
so don't bother posting a reply.
-t_dawolf
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
|