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.

DarkBASIC Discussion / Two guns firing

Author
Message
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 9th Oct 2003 20:02
I have two guns in my game (MP5s) that fire at the same time. I load them like this;


These work. When I try to fire, however, I only get 1 bullet at a time and that is always from a strange direction (i.e. a couple of game metres off the screen, but when the camera rotates the direction the bullets comes from changes). This is my code for loading the bullets.



And this is my code for firing the bullets.



This is my bulletlife command (so that there is not a constant stream of bullets, there is a delay between each one).



I have one other weapon, a colt and it works fine but it is only one gun and it is in the middle of the screen. I suspect that the problem may come form the positioning of the bullets to either side.

[img] [/img]

Am I the only one here who's really confused?____________________________________________________________Into the shadow of the valley of Death rode the 500
Coder Bob
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: United Kingdom
Posted: 11th Oct 2003 04:44
Seems you have 2 problems here 1 the position of your bullets and 2 That you only have one bullet per gun, am i right in assuming this?

If so...

1)Chamge this line "Position object 9,X#-50,Y#+115,Z#" to
"Position object 9,object position x(7),object position
y(7),object position z(7)," and do pretty much the same thing
for the other bullet and gun changing the object numbers
accordingly

2)You should create more than a single bullet per gun as the first
bullet may not be dead before you want to fire again. How many is
up to you but you could make it simple by making the exact amount
of bullets per magazine

Hope this helps

Bob
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 11th Oct 2003 10:14
For the multiple bullets (machine gun style) check out this post, i solved this problem for the fellow...

http://darkbasic.thegamecreators.com/?m=forum_view&t=18140&b=10

Hope I Helped...

Knowladge Belongs To The People...
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 11th Oct 2003 12:41 Edited at: 11th Oct 2003 18:13
My amount of shots in a short period of time is fine anyway; the bullet may have a slightly shorter range but it looks like it's a proper rapid fire weapon because I have made the bulletlife command short compared to with my colt.

Unfortunately, the bullets do not appear on screen now. They may be always in exactly the same position as the gun or something, I don't know exactly what the problem is.

P.S. Sorry, it's starting to sound like I want someone else to sort out every problem I come across, but that's not true. Some projects I just scrap (only kidding[img] [/img]).

Am I the only one here who's really confused?
In the shadow of the valley of death we need fear no evil

Login to post a reply

Server time is: 2025-05-20 17:28:38
Your offset time is: 2025-05-20 17:28:38