Crap, I suppose there is a problem with the "Source" button there. Sorry about the double post...
sync on:sync rate 100
make object sphere 1,-10000
load image "stars.bmp", 1
texture object 1,1
make matrix 1,2000,2000,10,10
randomize matrix 1,10
update matrix 1
set object light 1,0
set camera range 1,15000
scale object texture 1,5,5
make object cube 10, 10
position object 10,1000,0,1000
do
set cursor 0,0
print "FPS"
print screen fps()
print "Polygons"
print statistic(1)
`controls
if upkey() then move object 10,3
if downkey() then move object 10,-3
if leftkey() then turn object left 10,3
if rightkey() then turn object right 10,3
if shiftkey()
pitch object up 10,90
move object 10,1
pitch object down 10,90
endIf
if controlkey()
pitch object up 10,90
move object 10,-1
pitch object down 10,90
endIf
position object 1,camera position x(), camera position y(), camera position z()
chase_cam(10)
sync
loop
`---------
`chase cam
`---------
function chase_cam(id)
`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(id)+180)
`grab the objects current position
xPos#=object position x(id)
yPos#=object position y(id)
zPos#=object position z(id)
`other variables
camDist=100
camHeight=25
`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newzvalue(zPos#,yAng#,camDist)
`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos# < yPos#+camHeight then yCamPos#=yPos#+camHeight
`update camera position
position camera xCamPos#,yCamPos#,zCamPos#
point camera xPos#,yPos#+camHeight,zPos#
endfunction