ok.. my code is a bit messy at the moment as i'm just testing a few things.
Set Display mode 1280,1024,32
hide mouse
Sync on
Make matrix 1,50,50,25,25
load music "E:\01 - Mausoleum.mp3",1
loop music 1
load object "E:\crypt3.x",1
scale object 1,500,500,500
position object 1,330,1,120
set object cull 1,0
x#=330
y#=50
z#=120
position camera x#,y#,z#
`Camera setup and Positioning
make object sphere 200,3
Position camera x#,y#,z#
position object 200,x#+10,80,z#+10
point camera 500,0,500
color object 200,0
hide object 200
set object collision to polygons 1
do
oldx# = x#
oldz# = z#
`Fix Mouse Position
position mouse 640,512
`Player controls
`Mouse "Look" Routine
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())
rotate camera cx#,cy#,cz#
`Move Camera
if keystate(17)=1 then x#=newxvalue(x#,cy#,1) : z#=newzvalue(z#,cy#,1)
if keystate(31)=1 then x#=newxvalue(x#,cy#,-1) : z#=newzvalue(z#,cy#,-1)
if keystate(30)=1 then z#=newzvalue(z#,cy#-90,1) : x#=newxvalue(x#,cy#-90,1)
if keystate(32)=1 then z#=newzvalue(z#,cy#-90,-1) : x#=newxvalue(x#,cy#-90,-1)
`crouch routine
IF keystate(46)=1
if flag = 0
ButtonOn = 1 - ButtonOn
flag = 1
gy#=30
endif
else
flag = 0
gy#=100
ENDIF
`Update Camera Position
y#=get ground height(1,x#,z#)+gy#
position camera x#,y#+40,z#
position object 200,x#,y#,z#
if x#>=140 and z#>=800 and spacekey()=1
set object speed 1,10
play object 1
endif
obj= 1
if object collision(200,obj)>0 then x#=oldx# : z#=oldz#
`Debug info
set cursor 0,0
print "cy#=";cy#
print "cx#=";cx#
print "cz#=";cz#
print "Xpos";x#
print "Zpos";z#
sync
loop
Now i am aware that i don't need the Matrix in there, thats just from where i first tried to make the camera controls and had no objects.
Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD
I can see from your smile, you're not here for the sunset.