|
-
Jan 14th, 2005, 09:08 PM
#1
Thread Starter
Junior Member
help in animation game
My friend is making a duck hunt game. He went through the process of making the for statements to move the duck(s) around. He wants to know how to have it done randomely, with a different pattern of movement each time.
-
Jan 14th, 2005, 09:14 PM
#2
The picture isn't missing
Re: help in animation game
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jan 14th, 2005, 09:20 PM
#3
Re: help in animation game
We really can't help with that until we see some of the code he already has.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Jan 14th, 2005, 09:53 PM
#4
Thread Starter
Junior Member
Re: help in animation game
Option Explicit
Dim x As Integer, y As Integer, c As Integer
Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Private Sub command1_click()
Do
Command1.Visible = False
imgbird.Visible = True
x = 1000
For y = 125 To 8000 Step 10
imgbird.Top = y - 50
imgbird.Left = x
x = x + 16
Sleep 1
DoEvents
Next y
c = c + 1
For y = 8000 To 125 Step -10
imgbird.Top = y + 50
imgbird.Left = x
Sleep 1
DoEvents
Next y
For y = 125 To 8000 Step 10
imgbird.Top = y + 50
imgbird.Left = x
x = x - 19
Sleep 2
DoEvents
Next y
Loop While c < 4
End Sub
Private Sub birdisdead()
imgdead.Visible = True
imgbird.Visible = False
Dim deadbird As Integer
For deadbird = y To 11100 Step 20
imgdead.Top = deadbird
imgdead.Left = x
Sleep 4
DoEvents
Next deadbird
End Sub
Private Sub Form_Load()
Form1.BackColor = vbBlack
'c = 0
End Sub
Private Sub imgbird_Click()
birdisdead
imgbird.Visible = False
End Sub
-
Jan 14th, 2005, 10:28 PM
#5
The picture isn't missing
Re: help in animation game
Next time use vbcode tags.
Any you still haven't told us what the problem is.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jan 15th, 2005, 12:04 AM
#6
Re: help in animation game
He wants the bird to move in a random direction every time
-
Jan 15th, 2005, 04:42 AM
#7
Frenzied Member
Re: help in animation game
-
Jan 15th, 2005, 04:53 AM
#8
Junior Member
Re: help in animation game
you could place the duck image in a frame, and put this code in a timer.
VB Code:
Randomize
imgDuck.Left = Int((Frame1.Width - imgDuck.Width + 1) * Rnd)
imgDuck.Top = Int((Frame1.Height - imgDuck.Height + 1) * Rnd)
-
Jan 16th, 2005, 09:35 AM
#9
Thread Starter
Junior Member
Re: help in animation game
My friend is making a duck hunt game. For one level, he wants multiple birds to fly out on the screen in random directions (as well as random birds). Any help would be appreciated.
Thanks guys
-
Jan 16th, 2005, 10:30 AM
#10
Re: help in animation game
Read your other post, this is a dual post!!
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
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
|