Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > 9mm bullet hole


Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2003, 10:32 AM
the last ride the last ride is offline
Newcomer
 
Join Date: Mar 2003
Location: Jakarta,Indonesia
Posts: 11
Default 9mm bullet hole


hey, i'm currently developing a shooting game
i wanna make "9mm bullet hole" appears randomly in the picture box each time the picture box clicked

any suggestions ?
Reply With Quote
  #2  
Old 04-28-2003, 10:50 AM
Kaluriel's Avatar
Kaluriel Kaluriel is offline
Senior Contributor
 
Join Date: Jun 2002
Location: Where Heaven & Hell meet
Posts: 813
Default

setpixel or create a circular brush with black as color, or regions
__________________
"They say the the world will end in the same way it was created. I disagree, I think it'll end without the internet" ~ Kaluriel 2001
"The edit button is mightier than the doublepost" ~ Kaluriel 2003
Reply With Quote
  #3  
Old 04-28-2003, 02:01 PM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

Or you can draw a 9mm diameter bullet hole in MS Paint and draw it using transparency (BitBlt with vbSrcAnd / vbSrcPaint). Have you used the graphical API before?
You can start the X & Y like this:
X = Int(Rnd * (PicBox.ScaleWidth - BulletWidth))
Y = Int(Rnd * (PicBox.ScaleHeight - BulletHeight))
with Randomize in the Form_Load...
Or you can get a 9mm and just go buckwild on your monitor.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #4  
Old 04-29-2003, 02:37 AM
the last ride the last ride is offline
Newcomer
 
Join Date: Mar 2003
Location: Jakarta,Indonesia
Posts: 11
Default 'bout the bullet hole

ok..i've tried it

now the problem is i'm using the SetCapture and ClientToScreen API and
....yes i can get the cursor coordinate

but each time i click the picture box the "bullet hole" appears but
not in the cursor coordinate (a little bit far from the cursor)
Reply With Quote
  #5  
Old 04-29-2003, 06:43 AM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

What does your code look like?
Are you using the GetCursorPos API?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #6  
Old 04-30-2003, 07:28 AM
the last ride the last ride is offline
Newcomer
 
Join Date: Mar 2003
Location: Jakarta,Indonesia
Posts: 11
Default getcursorpos ?

my cursor looks like a crosshair

i only use the SetCapture & ClientToScreen

Edit: Please stop creating new threads for a continuing discussion -- use the reply or quick reply buttons. Thanks.

Last edited by lebb; 04-30-2003 at 08:12 AM.
Reply With Quote
  #7  
Old 04-30-2003, 04:07 PM
the last ride the last ride is offline
Newcomer
 
Join Date: Mar 2003
Location: Jakarta,Indonesia
Posts: 11
Default

Quote:
Originally Posted by Iceplug
What does your code look like?
Are you using the GetCursorPos API?



this is my problem

each time i clicked the form the bullet hole appears
but then came another problem


i put 2 crosshair called Image1(0) and Image1(1) in the form

Dim count As Integer

Private Sub Form_Load()
count = 1
End Sub

Private Sub Form_Click()
Load Image1(NewElement)
Image1(NewElement).Picture = Image1(0).Picture
Image1(NewElement).Top = ptpoint.Y - 550
Image1(NewElement).Left = ptpoint.x - 550
Image1(NewElement).Visible = True
NewElement = NewElement + 1
count = count + 1

the problem is i can'r refresh (remove all the bullet hole except the Image1(0) and Image1(1) from the form)
all i can do is make them invisible
Reply With Quote
  #8  
Old 04-30-2003, 06:47 PM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

In cases like this, you'd probably want to have your Image1(0) invisible and somewhere else on your form, and just load all new images that you want to unload at run-time.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #9  
Old 04-30-2003, 07:51 PM
clockworkorange clockworkorange is offline
Junior Contributor
 
Join Date: Mar 2003
Posts: 238
Default

use the picture box function mouse move

then type mousex=x
mousey=y

u make the mousex/y , so u can just use mousexy for whatever
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting blank bullet fields from Word brad Word, PowerPoint, Outlook, and Other Office Products 1 02-05-2003 12:35 AM
Hole In Form jennysmith General 4 01-10-2003 05:28 AM
bullet question on how i should work the array aaa Game Programming 3 01-01-2003 07:03 AM
game bullet problems??? piggybank1974 Game Programming 5 08-10-2002 09:50 PM
Hole (in my head?) pponchot General 4 05-23-2001 12:59 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->