try this:
rem Generic Template
rem Player = object 10
rem map= object 1000
set display mode 1024,768,32
SYNC ON
SYNC RATE 60
backdrop on
color backdrop rgb(10,10,100)
autocam off
set global collision off
x#=-150.0:z#=38.0:a#=0.0:s#=0.0:h#=0.0
cx#=0.0:cy#=0.0:cz#=0.0
gosub Loadmap
gosub makewalker
gosub resetcam
rem --------------Main Loop -----------------------
do
gosub printdata
gosub camera_controls
gosub update_camera
gosub Playercontrol
SYNC
loop
rem -------------ROUTINES--------------------
Playercontrol:
rem ---- Control Character ----
x#=newxvalue(x#,a#,s#)
z#=newzvalue(z#,a#,s#)
h#=10000-intersect object(1000,x#,10000,z#,x#,-10000,z#)
position object 10,x#,h#,z#
yrotate object 10,a#
if upkey()=1 and s#<3 then s#=s#+0.05
if downkey()=1 and s#>-2 then s#=s#-0.05
if leftkey()=1 then a#=wrapvalue(a#-0.5)
if rightkey()=1 then a#=wrapvalue(a#+0.5)
if inkey$()="ù" then s#=0.0
return
rem -------CAMERA--------
camera_controls:
mymousez=mousemovez()
if mymousez>0 then camhgt=camhgt+2:camdist=camdist-3
if mymousez<0 then camhgt=camhgt-2:camdist=camdist+3
if inkey$()="<" then gosub Resetcam
return
rem camera update
update_camera:
rem Position camera to the back of the character
ca#=wrapvalue(a#)
cx#=newxvalue(x#,ca#,camdist)
cz#=newzvalue(z#,ca#,camdist)
cy#=h#
position camera cx#,cy#+camhgt,cz#
rem Point camera at object
point camera x#,h#+camhgt,z#
return
rem camera reset
Resetcam:
set camera range 1,20000
camdist=-50
camhgt=20
return
printdata:
set cursor 0,0
print " Polys=",statistic(1)
print " FPS=",screen fps()
print " x#= ",x#
print " z#= ",z#
print " height#= ",h#
print " angle#= ",a#
print " speed#= ",s#
print " mouse wheel = camera height"
return
makewalker:
make object cone 10,10
color object 10,rgb(160,10,10)
scale object 10,100,200,100
xrotate object 10,90
fix object pivot 10
return
Loadmap:
load object "psp.x",1000
set object 1000,1,1,0,1,1,1,1
return
end
put the psp.x in the same folder where the .dba is
works perfectly here
cheers