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 / Any bullet shooting tutorials?

Author
Message
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 17th Apr 2007 19:39
I am making a space combat game like star wraith or freespace 2. It has a fps view and fps controls. I am looking for a tutorial that would help me have bullets shoot from the two corners of the bottom screen. I know how to do crosshairs which I have in the middle for aiming. What I dont wont is to make a gun or object that shoots. But just the bullets come from the camera view like in Freespace 2. I have
the bullet texture already. If you wanna see its in the view button. I have seen tutorials on how to shoot bullets before but they were either in a thirdperson view or coming out of a gun. The effect I want is to have a rapid fire machine gun style trail effect.

gm07

Attachments

Login to view attachments
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 17th Apr 2007 22:36
Does anyone know were bullet tutorials are? Or even show me an example
code? Like I said I have searched already and the only ones I could find were for either thirdperson games or coming out of a gun. I want mine to look like there just coming out of nowhere on the camera view like in space combat games. Please help I have looked and looked but could not find anything like that.

gm07
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Apr 2007 00:00
Exactly what part of it are you having problems with? You need to be a bit more specific.

The following covers the coding behind shooting bullets and although it's in 2D, the theory for 3D is the same but with an added Z co-ordinate.

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

See tutorial 11.

In your program, start out by creating a single bullet stream coming from the nose of your craft. When it works, simply alter the X,Y,Z bullet origin to one of the wings. When that looks right, replicate the code with the origin at the other wing.

TDK_Man

game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 18th Apr 2007 02:35
thanks that helped alot!

gm07
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Apr 2007 09:16
Here's a little demo I've done to point you in the right direction... It doesn't do exactly what you want, but it should give you some clues.

As it is only to demonstrate a method of double firing from wing guns, I've only used simple X/Y/Z rotation so it has the gimbal problem.

You can also figure out the first person view too...



Q and A are increase and decrease speed, mouse steers and left mouse button fires.

TDK_Man

game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 18th Apr 2007 20:05 Edited at: 18th Apr 2007 20:18
Thank you so much TDK for your amazing help!I really appreciate it. With your help I have now figured out the basics of DPP and am on my way to creating a very good space combat game that I will release hopefully in a couple of months! Also I will give credit to you in my game!

gm07
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 18th Apr 2007 23:14
I have one more question. I have switched from an fps view to a third person view with a model. I have made simple third person controls. I used the wasd keys to control the ship. What it cant do is look up or down. I want to do that but with the mouse. The same way its done in a
fps camera but its moving the object as well. Here is my code



gm07
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Apr 2007 00:00
Mouselook code:



Just put it in your main loop. It won't work if you are also using Set Camera To Follow though.

TDK_Man

game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 19th Apr 2007 00:30 Edited at: 19th Apr 2007 03:52
Thanks but that is not what I wanted to do. What I want is to have my camera stay where it is locked on a still view of the ship which it is but turn my 3d ship model up,right,left,down with the mouse. I have it where it moves with the wasd keys but like i said I want to point my object in the direction I want to move it with the mouse.What I am trying to do is create realistic space flight controls in sorta the same way the space shuttle or an airplane flys.I have also uploaded a pic of what I am talking about in my game.

gm07

Attachments

Login to view attachments
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 19th Apr 2007 03:55 Edited at: 19th Apr 2007 04:17
How do I steer my ship model with the mouse.Like I said before I want the camera to stay where it is and stuck to the object. I am also using the wasd as movement keys which i have done already. All I need is help steering my object with the mouse. Also here is something else I forgot to ask. How do make an object and camer roll at the same time? In most flight games it is usally the q and r keys or q and e keys.

gm07

Login to post a reply

Server time is: 2024-11-25 19:36:11
Your offset time is: 2024-11-25 19:36:11