Rem Project: FPS
Rem Created: 9/10/2004 11:04:47 AM
Rem ***** Main Source File *****
hide mouse
sync on:sync rate 0
set camera range 0.1,5000
autocam off
position camera 0,50,10,50
load image "crosshair.bmp",1
load object "gunhand1.x",1
load object "school.3ds",2
rotate object 2,0,0,44
make object sphere 3,2
lock object on 1
scale object 1,80,80,80
position object 1,0,0,0
scale object 2,400,400,400
bullet=30
sprite 1,295,200,1
make matrix 1,1000,1000,50,50
do
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
cx#=camera angle x(0): cy#=camera angle y(0)
if keystate(30)=1 then yrotate camera 0,cy#-90 : move camera 1 : yrotate camera 0,cy#
if keystate(32)=1 then yrotate camera 0,cy#+90 : move camera 1 : yrotate camera 0,cy#
if keystate(17)=1 then xrotate camera 0,0 : move camera 0,1 : xrotate camera 0,cx#
if keystate(31)=1 then xrotate camera 0,0 : move camera 0,-1 : xrotate camera 0,cx#
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<300 then xrotate camera 0,300
if camera position y()>10 then position camera camera position x(0),10,camera position z(0)
if camera position y()<10 then position camera camera position x(0),10,camera position z(0)
if object collision (1,2)=1 then print "hello"
`it always says hello
if mouseclick()=1 and bullet>9 then play object 1,0,8:bullet=0
if bullet<10
move object 3,30
bullet=bullet+1
endif
if bullet>9
position object 3,camera position x(0),camera position y(0),camera position z(0)
rotate object 3,camera angle x(0),camera angle y(0),0
endif
sync
loop
F*** the world and rock on!