This is an idea
rem Generic Template
rem By Scorpyo
rem Player = object 10
set display mode 1024,768,32
SYNC ON
SYNC RATE 60
backdrop on
color backdrop rgb(10,100,100)
autocam off
set global collision off
x#=0.0:z#=50.0:a#=0.0:s#=0.0:h#=0.0
cx#=0.0:cy#=0.0:cz#=0.0:ca#=0.0:camght=50
camrot=0:camdist=0:camlen=0
gosub Setupland1
gosub makewalker1
gosub resetcam
do
if inkey$()="e" then sync rate 0
if inkey$()="E" then sync rate 60
gosub printdata
gosub update_camera
gosub checkplane
gosub Playercontrol
SYNC
loop
rem -------------ROUTINES--------------------
Setupland1:
randomize 1
for n=1 to 9
make object plain n,200,200
r=100:g=rnd(200):b=100
color object n,rgb(r,g,b)
set object n,1,1,0,1,1,1,1
xrotate object n,270
position object n,0.0,0.0+n*5,pz#
pz#=pz#+200.0
next n
return
checkplane:
for n=1 to 9
pcheck#=intersect object(n,x#,10000.0,z#,x#,-10000.0,z#)
if pcheck#<>0.0 then planenum=n:h#=10000-pcheck#:return
if pcheck#=0.0 then h#=0.0
next n
return
Playercontrol:
rem ---- Control Character ----
x#=newxvalue(x#,a#,s#)
z#=newzvalue(z#,a#,s#)
position object 10,x#,h#,z#
yrotate object 10,a#
if upkey()=1 and s#<1.2 then s#=s#+0.2
if downkey()=1 and s#>-1.2 then s#=s#-0.2
if leftkey()=1 then a#=wrapvalue(a#-1)
if rightkey()=1 then a#=wrapvalue(a#+1)
if inkey$()="ù" then s#=0.0
return
rem -------CAMERA--------
rem camera update
update_camera:
position mouse 300,300
rem Position camera to the back of the character
ca#=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=-150
camhgt=80
return
printdata:
set cursor 0,0
print "Polys=",statistic(1)
print "FPS=",screen fps()
print "x#= ",x#
print "z#= ",z#
print "height= ",h#
print "pcheck#= ",pcheck#
print "player angle= ",a#
print "speed= ",s#
print "plane number= ",planenum
return
rem -------------Characters----------------
makewalker1:
make object sphere 10,10
return
end