sync on
sync rate 60
hide mouse
load static objects "files/levelbank/testlevel/universe.dbo",0
make object sphere 20,-50000 : ` create skysphere a size in minus will make it inverted
load image "media/Sunnysky.bmp",5 : ` sky texture
texture object 20,5 : ` apply sky texture to skysphere
position object 20,0,0,0 : ` position skysphere remove if sky moves with player
Make object sphere 10,50 :hide object 10
Position object 10,5,25,75
Rem Prepare bullet
Make object sphere 2,5
load image "media/gold.bmp",3
Texture object 2,3
Hide object 2
do
rem player movement
If Upkey()=1 then Move object 10,10
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
Rem Store Object angle Y in aY#
aY# = Object angle Y(10)
Rem Control input for camera
If Upkey()=1 then Move object 10,1
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,30,cZ#
Rem point the camera at the player object
Point camera X#,30,Z#
If Spacekey()=1 and Bulletlife=0
set object to camera orientation 2
Position object 2,X#,Y#+20,Z#
Bulletlife = 100
Show object 2
Endif
if bulletlife>0
Dec bulletlife
Move object 2,20
If bulletlife=0 then hide object 2
endif
sync
LOOP
There isnt anything wrong with the code as far as i can see. Without the model packs added on, i have loaded maps from fpsc with the defualt entities,segments in dbpro with no problems.