Here's a basic example:
sync on : sync rate 60
`Make a player object
make object sphere 1,5
`Make the ground
make object plane 2,100,100
xrotate object 2,90
`Make some random obstacles
for c=1 to 30
make object box c+2,rnd(10),rnd(10),rnd(10)
position object c+2,rnd(100)-50,object size y(c+2)/2,rnd(100)-50
sc_setupobject c+2,0,2
sc_updateobject C+2
next c
`Main loop
DO
`Move player
if upkey() then move object 1,1
if downkey() then move object 1,-1
if leftkey() then yrotate object 1,object angle y(1)-2
if rightkey() then yrotate object 1,object angle y(1)+2
`Camera control
position camera object position x(1),object position y(1),object position z(1)
xrotate camera 25
yrotate camera object angle y(1)
move camera -20
`MOVE CAMERA UP PAST COLLISIONS
while sc_raycast(0,camera position x(),camera position y(),camera position z(),object position x(1),object position y(1),object position z(1),1)
move camera sc_getcollisiondistance()+1
endwhile
SYNC
LOOP
`Random memblock command for Sparky's
null=memblock exist(1)
Any questions, please ask.