its kind of long, and the media is missing, but here you go
btw the gun i used is the mp5 from darkMATTER
`demo FPS
`by Zach Turnlund
`10/2/03
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`///////////////startup///////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`stuff
hide mouse
sync on
sync rate 0
autocam off
`load sphere
load object "spheres\space station\ss.3ds",3
xrotate object 3,270
scale object 3,12,12,12
position object 3,60,0,380
fix object pivot 3
`load test
load object "bld\level1-2.x",1
scale object 1,10,10,10
position object 1,0,0,0
sx=object size x(1)/2
sy=object size y(1)/2
sz=object size z(1)/2
sx1=sx*-1
sy1=sy*-1
sz1=sz*-1
make object collision box 1,sx1,sy1,s1z,sx,sy,sz,1
`load weapon
load object "mod\weapon\mp5\mp5.3ds",2
scale object 2,1500,1500,1500
position object 2,1,-4,4
lock object on 2
sx2=object size x(2)/2
sy2=object size y(2)/2
sz2=object size z(2)/2
sx3=sx*-1
sy3=sy*-1
sz3=sz*-1
make object collision box 2,sx3,sy3,sz3,sx2,sy2,sz2,1
`variables
y#=16
move#=1
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`//////////////////main loop//////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`main loop
do
`variables
oldx#=camera position x()
oldz#=camera position z()
gx#=object position x(2)
gy#=object position y(2)
gz#=object position z(2)
`backdrop
color backdrop 0
`print
gosub print
`camera
gosub controls
`sync+loop
sync
loop
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////sub-functions///////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
print:
`print positions
set cursor 0,0
print "Camera X: ";camera position x()
set cursor 0,15
print "Camera Z: ";camera position z()
`return
return
`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
`///////////////////////////////////////////////////////////
controls:
`crouch
if inkey$()="0"
if yoke#=0 then y#=y#-.5
if y#=8
yoke#=1
else
yoke#=0
endif
move#=.4
else
if yokey#=0 then y#=y#+.5
if y#=>16
yokey#=1
else
yokey#=0
endif
move#=1
endif
`mouselook
mx=mousemovex()
my=mousemovey()
rx#=wrapvalue(camera angle x()+my*.4)
ry#=wrapvalue(camera angle y()+mx*.4)
rotate camera rx#,ry#,0
`camera positions
x#=camera position x()
z#=camera position z()
cya#=camera angle y()
`///////////here is the collision code!/////////////////
`/////////////////////////////////////////////////////////
`colide
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
if object collision(2,1)>0
set cursor 100,100
print "hit"
else
set cursor 100,100
print "not hit"
endif
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////
`pos cam
position camera x#,y#,z#
`main controls(forward+backward+sidestep)
if leftkey()=1
x#=newxvalue(x#,wrapvalue(cya#-90.0),move#)
z#=newzvalue(z#,wrapvalue(cya#-90.0),move#)
endif
if rightkey()=1
x#=newxvalue(x#,wrapvalue(cya#+90.0),move#)
z#=newzvalue(z#,wrapvalue(cya#+90.0),move#)
endif
if upkey()=1
x#=newxvalue(x#,cya#,move#)
z#=newzvalue(z#,cya#,move#)
endif
if downkey()=1 and move#=1
x#=newxvalue(x#,cya#,-1)
z#=newzvalue(z#,cya#,-1)
endif
if downkey()=1 and move#=.4
x#=newxvalue(x#,cya#,-.4)
z#=newzvalue(z#,cya#,-.4)
endif
`position camera
position camera x#,y#,z#
`rotate sphere
turn object left 3,.02
position listener x#,16,z#
`return
return
one problem is the gun looks really funky(like the top texture is missing) and it won't seem to register the objects x,y,or z position....thanx
Bishop
p.s.-any improvment, don't hesitate to make...
"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."