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 / gun bullet help

Author
Message
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 5th Jan 2003 23:12
hi i am having a problem with my first person shooter cus i don't know how to make a restriction on the bullets using arrays so that if u have 0 bullets it won't shoot but will play a noise and if u press R on the keyboard it reloads the gun has anyone got an example of that that i can use.
please help

cloud
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 6th Jan 2003 08:09
if bullets > 0
shoot
else
dont shoot
endif

if reloadbutton() = 1
bullets = howevermany in a clip
endif

just pseudo code of course.. hope it helps
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 6th Jan 2003 14:31
thanks but i'm using arrays like:
dim clip(9)
dim ammo(9)

ammo(1)=6
clip(1)=50

i got it so when u shoot the ammount of bullets which is 6 goes down but when it reaches zero it just goes -1 etc and i can't get it so that if ammo(1)=0 then it wont shoot but plays a sound and how do i get it to cound clips and the ammo in it.

Login to post a reply

Server time is: 2024-04-23 08:53:19
Your offset time is: 2024-04-23 08:53:19