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 Professional Discussion / Weapon shooting problem. Box2D

Author
Message
z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Oct 2011 02:37
For some reason when I shoot my weapon and I change between my weapons while im shooting the projectiles stop spawning. Here's the code for my weapon selection
And here's the code that is the shoot function


It makes no sense why it doesn't work. If you stop shooting then change weapon and start shooting again it works.

life is short but so am i
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 25th Oct 2011 04:14
can you provide the whole loop in the main program
z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 26th Oct 2011 01:03
Yeah sure, here it is :-


life is short but so am i
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 11:37 Edited at: 26th Oct 2011 11:38
My guess is you aren't setting the value of "f" near the start of your SHOOT function so only weapon 0 is updated:


z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 27th Oct 2011 02:29
Sorry to say but i'm confused Would you mind looking at my code and fixing it for me please.

life is short but so am i
z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 29th Oct 2011 02:28
I've had numerous attempts but I still can't find the solution. Would someone mind looking over my code please?

life is short but so am i
z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 2nd Nov 2011 23:39 Edited at: 3rd Nov 2011 01:21
Sorry to post again. But i'm still in need of help, really can't figure this one out :/

EDIT: For some reason if you play with the frequency variables certain values stop the problem from happening.

life is short but so am i
z i l c h vortex
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 4th Nov 2011 00:51
Problem is fixed noww. Something so simple that it was annoying when i found out the
statement needed to be


Thank you to everyone that helped.

life is short but so am i

Login to post a reply

Server time is: 2026-07-10 23:13:47
Your offset time is: 2026-07-10 23:13:47