sync on : sync rate 60
autocam off : color backdrop rgb(255, 255, 255)
load object "Track.dbo", 1 : set object collision to polygons 1
make object sphere 2, 10 : position object 2, 0, 100, -50 : hide object 2
acceleration as float = 70.0
speed as float = 0.0
make camera 1 : set current camera 1 : position camera 1, 0, 20, 0
DO
position camera 1, object position x(2), object position y(2), object position z(2)
accelerate()
gravity()
sync
LOOP
FUNCTION Accelerate()
if upkey()
inc speed, (acceleration/(speed+1.0))
else
dec speed, (acceleration/(speed+1.0))
endif
move object 2, speed
ENDFUNCTION
FUNCTION Gravity()
origXrot= object angle x(2)
origYrot= object angle y(2)
origZrot= object angle z(2)
rotate object 2, 90, 0, 0
move object 2, 2
if object collision(2, 0) then move object 2, -2
rotate object 2, origXrot, origYrot, origZrot
ENDFUNCTION