Here is some code! It works for DBP (Which i got for Xmas!) Dunno if it works in DBC. But try it anyways! Ill keep looking though!
Rem Project: New FPS
Rem Created: 3/28/2004 2:27:41 PM
Rem ***** Main Source File *****
`setup
sync on
sync rate 0
hide mouse
autocam off
`global
global gun=111
global cam=112
global camgun=113
`dims
`dims
dim active(100,2)
maxwait=50
`make gun
make object cylinder gun,1
scale object gun,100,900,100
color object gun,rgb(0,0,255)
xrotate object gun,90
fix object pivot gun
`make bullets
for b=1 to 100
make object sphere b,.5
color object b,rgb(255,0,0)
hide object b
next b
`make player
make object sphere cam,1
make object cylinder camgun,1
scale object camgun,100,900,100
color object camgun,rgb(0,0,255)
xrotate object camgun,90
fix object pivot camgun
make mesh from object 1,camgun
delete object camgun
add limb cam,1,1
offset limb cam,1,1.5,-2,1
hide object cam
`make reference mat
make matrix 1,100,100,10,10
`var
ammo#=500
`main loop
do
`backdrop
color backdrop 0
`variables
cay#=camera angle y()
cax#=camera angle x()
x#=camera position x()
z#=camera position z()
if xLook>60 and xLook<300 then xLook=xl
xl=xLook
`controls
mx=mousemovex()
my=mousemovey()
rotx#=wrapvalue(cax#+my)
roty#=wrapvalue(cay#+mx)
if rotx#>80 and rotx#<300 then rotx#=ro#
ro#=rotx#
rotate camera rotx#,roty#,0
if upkey()=1 then x#=newxvalue(x#,cay#,.3) : z#=newzvalue(z#,cay#,.3) : sway#=1 : else : sway#=0
if downkey()=1 then x#=newxvalue(x#,cay#,-.3) : z#=newzvalue(z#,cay#,-.3) : swayb#=1 : else : swayb#=0
if rightkey()=1 then x#=newxvalue(x#,cay#+90,.3) : z#=newzvalue(z#,cay#+90,.3)
if leftkey()=1 then x#=newxvalue(x#,cay#+90,-.3) : z#=newzvalue(z#,cay#+90,-.3)
position camera x#,7,z#
`pos gun
gosub posgun
gosub shoot
`print ammo
set cursor 0,0
print "Ammo: ";ammo#
`end
sync
loop
posgun:
`pos camgun
position object cam,x#,7,z#
set object to camera orientation cam
`limb positions
cgx#=limb position x(cam,1)
cgz#=limb position z(cam,1)
cgy#=limb position y(cam,1)
cgay#=object angle y(gun)
cgax#=object angle x(gun)
`pos gun
position object gun,cgx#+xsway#,cgy#,cgz#
set object to camera orientation gun
`ret
return
shoot:
`for
for b=1 to 100
`shoot
if mouseclick()=1 and ammo#>0 and active(b,1)=0 and (timer()-lasttime)>maxwait
position object b,cgx#,cgy#,cgz#
set object to object orientation b,gun
active(b,1)=1
active(b,2)=1000
show object b
ammo#=ammo#-1
lasttime=timer()
endif
`move bullet
if active(b,1)=1
move object b,2
active(b,2)=active(b,2)-1
endif
`stop when bullet run out
if active(b,2)<0
active(b,1)=0
active(b,2)=0
hide object b
endif
next b
return
DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)