Quick Search for:  in language:    
Create,your,duck,shoot,style,game,even,kill,b
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,149,602. lines
 Jobs: 144. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
 
PDC 2003: Make the connection
Login



Latest Code Ticker for Visual Basic.
Click here to see a screenshot of this code!HistoryWriter Add-In V.1
By Zvonko Kostovski on 9/3

(Screen Shot)

Click here to see a screenshot of this code!Control Winamp
By Dennis Wollentin on 9/3

(Screen Shot)

Fake Virus Version 1.0
By C.J. Laing on 9/3


][String Encoder
By Andron Smth on 9/3


Font Catalog
By Bill Adams on 9/3


professional search
By Ziad Said on 9/3


Click here to see a screenshot of this code!Drew's Meta Tag Generator
By Drew Phillips on 9/3

(Screen Shot)

Fast BruteForce Class
By §e7eN on 9/3


Click here to see a screenshot of this code!Lotus Domino Exploit Scanner
By §e7eN on 9/3

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Duck Shoot Game

Print
Email
 

Submitted on: 4/6/1999
By: Ed Hockaday 
Level: Not Given
User Rating: By 101 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 13209 times.
 
 
     Create your own duck shoot style game, you can even kill your best buddy, just get a picture of him!!!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Duck Shoot Game
' Description:Create your own duck shoot
'     style game, you can even kill your best 
'     buddy, just get a picture of him!!!
' By: Ed Hockaday
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1568&lngWId;=1'for details.'**************************************

Leave Picture1 blank, make Picture2's picture a "kill picture" (so when the target is hit a bullet hole appears In it) and make Picture3's Picture the blank target (ie an "unwounded target")
Copy and paste this into a notepad and save as form1.frm
VERSION 5.00
Begin VB.Form Form1 
BorderStyle =4 'Fixed ToolWindow
ClientHeight=3195
ClientLeft =45
ClientTop=285
ClientWidth =4680
LinkTopic="Form1"
MaxButton=0'False
MinButton=0'False
ScaleHeight =3195
ScaleWidth =4680
ShowInTaskbar=0'False
StartUpPosition =3 'Windows Default
Begin VB.Timer tmrSeconds 
Left=600
Top =960
End
Begin VB.CommandButton cmdReset 
Caption ="&Reset;"
Height =375
Left=120
TabIndex=5
Top =2760
Visible =0'False
Width=855
End
Begin VB.PictureBox Picture3 
Appearance =0 'Flat
BackColor=&H00C0C0C0;&
BorderStyle =0 'None
ForeColor=&H80000008;&
    Height =495
    Left=960
    ScaleHeight =495
    ScaleWidth =495
    TabIndex=4
    Top =2040
    Visible =0'False
    Width=495
    End
    Begin VB.CommandButton cmdStart 
    Caption ="&Start;"
    Height =375
    Left=120
    TabIndex=3
    Top =2760
    Width=855
    End
    Begin VB.CommandButton cmdExit 
    Caption ="&Exit;"
    Height =375
    Left=3720
    TabIndex=2
    Top =2760
    Width=855
    End
    Begin VB.PictureBox Picture2 
    Appearance =0 'Flat
    BackColor=&H80000004;&
    BorderStyle =0 'None
    ForeColor=&H80000008;&
        Height =495
        Left=480
        ScaleHeight =495
        ScaleWidth =495
        TabIndex=1
        Top =2040
        Visible =0'False
        Width=495
        End
        Begin VB.PictureBox Picture1 
        BackColor=&H008080FF;&
        BorderStyle =0 'None
        Height =495
        Left=1920
        ScaleHeight =495
        ScaleWidth =495
        TabIndex=0
        Top =1320
        Width=495
        End
        Begin VB.Timer Timer1 
        Interval=1
        Left=480
        Top =240
        End
        End
        Attribute VB_Name = "Form1"
        Attribute VB_GlobalNameSpace = False
        Attribute VB_Creatable = False
        Attribute VB_PredeclaredId = True
        Attribute VB_Exposed = False
        Option Explicit
        Dim DeltaX
        Dim DeltaY
        Dim gTimerSpeed
        Dim gGameOn As Boolean
        Dim gHit As Boolean
        Dim gSeconds
        Dim gShots
        Dim gTime
Private Sub cmdExit_Click()

Unload Form1 End Sub
Private Sub cmdReset_Click()
Picture1.Picture = Picture3.Picture Screen.MousePointer = vbCrosshair Timer1.Interval = 0 DeltaX = 100' Initialize variables. DeltaY = 100 cmdStart.Visible = True cmdExit.Visible = True cmdReset.Visible = False End Sub
Private Sub cmdStart_Click()
Picture1.Picture = Picture3.Picture Screen.MousePointer = vbCrosshair Timer1.Interval = 1 gTimerSpeed = 1 DeltaX = 100' Initialize variables. DeltaY = 100 cmdReset.Visible = False cmdStart.Visible = False cmdExit.Visible = False gHit = False gShots = 0 gGameOn = True gTime = 0 tmrSeconds.Interval = 1000 End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
gShots = gShots + 1 End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If gGameOn = True Then Timer1.Interval = 0 Picture1.Picture = Picture2.Picture Screen.MousePointer = Default cmdReset.Visible = True cmdExit.Visible = True gHit = True If gShots = 0 Then MsgBox "It took you " & gShots + 1 & " shot and " & gTime & " seconds to kill him!" ElseIf gShots > 0 Then MsgBox "It took you " & gShots + 1 & " shots and " & gTime & " seconds to kill him!" End If
gGameOn = False tmrSeconds.Interval = 0 Exit Sub ElseIf gGameOn = False Then Exit Sub End If
End Sub
Private Sub Timer1_Timer()
If gHit = True Then Timer1.Interval = 0 Exit Sub End If
If gTimerSpeed < 50 Then gTimerSpeed = gTimerSpeed + 1 Timer1.Interval = gTimerSpeed Picture1.Move Picture1.Left + DeltaX, Picture1.Top + DeltaY If Picture1.Left < ScaleLeft Then DeltaX = 100 If Picture1.Left + Picture1.Width > ScaleWidth + ScaleLeft Then DeltaX = -100 End If
If Picture1.Top < ScaleTop Then DeltaY = 100 If Picture1.Top + Picture1.Height > ScaleHeight + ScaleTop Then DeltaY = -100 End If
End Sub
Private Sub tmrSeconds_Timer()
gTime = gTime + 1 End Sub


Other 7 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/10/1999 1:39:00 PM:Ian Ippolito
Make sure you follow the advice
on 
setting pictures1,2,3 to get
the full 
effect!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/1999 5:44:00 PM:Mike
Cool man! But lets see if it works!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/15/1999 1:33:00 PM:Travis
Well it works on mine... but when i 
shoot the guy, it doesnt change images!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/17/1999 1:31:00 PM:Captain Needa
Is there as place where I can actually 
download the entire code?
This thing 
is really screwing me up!
Thanx
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/19/1999 2:55:00 AM:Guus van den Berg
Great, But you should add some pre-made 
bulletholes!
G.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/1999 10:21:00 AM:Adam Foulkes
i think thAT your page is realy good 
BUT , why the hell dont you make the 
actual vb files available for download 
in a .zip format , thats why i get my 
vbb stuff from other sites that have 
this feture , thanx
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/23/1999 7:57:00 AM:seggie
What does the form look like? I am not 
sure how many command buttons and pic 
boxes this thing is supposed to 
have.
Any help what so ever would be 
appreciated.
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/26/1999 8:30:00 AM:Jon Leister
how many pictures and buttons are you 
suppost to have and what are they 
suppost to be named? Also, how should 
the form look when it is layed out and 
which codes go in which buttons and 
stuff?  Please e-mail me back real soon 
because I have to do this for a final 
project for school, and I have no idea 
what the hell I am doing.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/26/1999 4:08:00 PM:Zuhair
Haven't tried it yet but thanx.
Hope 
it works
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/3/1999 5:10:00 PM:Drakosnah Hurreala
Can you please send me the full source 
code? I'm lazy. :) Thanks! 
Drakosnah@Hotmail.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/16/1999 6:20:00 AM:Shawn
thanx for the codes. they're really 
good and helpful 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/22/1999 11:14:00 PM:smoke33
Pretty cool. :o) Works 
great!
-smoke33
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/12/1999 2:27:00 AM:heresy
very creative...  i like this.  but you 
should post this
(with all forms, 
etc.) in ZIP format!  and if you want, 
even compile
it while you're at it!  
thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/25/1999 3:02:00 PM:Juuh
Something like "ZIP"???!!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/22/2000 8:09:20 PM:vbproggyboy
that is pretty cool. Good Job..The 
shots missed it messed up a little bit 
but that is alright!!Good Job
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.