Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need Help with Making Bullets and firing them from my gun

Author
Message
FeaR
20
Years of Service
User Offline
Joined: 28th Mar 2004
Location:
Posted: 28th Mar 2004 23:30
Hey, can any1 tell me a code to shoot bullets out of my gun
this is my code so far, TY!!

-FeaR-

Gjl
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 29th Mar 2004 22:37 Edited at: 29th Mar 2004 22:39
Ok when the left mouse button is held down, every 0.5 seconds (or however quickly you want your gun to shoot) create an object (the bullet) at the centre of the screen and move it in the same direction as the camera (might wanna make this bullet invisible). Use polygonal collision to test if the bullet hits an enemy or wall or whatever, and destroy the bullet, kill the enemy - whatever. You might also want a muzzle flare or whatever you call it to flash at the end of the gun as well as a nice firing sound effect.

It looks like you've just extracted that code from a gun bobbing tutorial I saw earlier. If you can't translate what I've said above into code then you need to learn the basics first and then you should be able to work out how you are going to go about making your game. You ought to check out the FPS tutorial included with DBPro if you are having trouble. It's at the back of the manual and tells you how to make a (very) basic FPS game.

Login to post a reply

Server time is: 2024-11-26 10:22:04
Your offset time is: 2024-11-26 10:22:04