I can move the camera using the wsad keys while rotating the camera with the mouse:
sync on : sync rate 60 : hide mouse : color backdrop rgb(100,100,255)
autocam off
rem create floor
make object box 1,400,10,400 : position object 1,0,-5,0
rem create walls
make object box 2,400,100,10 : position object 2,0,50,-200
make object box 3,400,100,10 : position object 3,0,50, 200
make object box 4,10,100,400 : position object 4,-200,50,0
make object box 5,10,100,400 : position object 5, 200,50,0
rem Set floor and walls to box collision for rectangle roamer
make object collision box 1,-200,-5,-200,200,5,200,0
make object collision box 2,-200,-50,-5,200,50,5,0
make object collision box 3,-200,-50,-5,200,50,5,0
make object collision box 4,-5,-50,-200,5,50,200,0
make object collision box 5,-5,-50,-200,5,50,200,0
rem create collision platform
make object box 6,100,12,100
position object 6,0,5,0
rem rectangle roamer for box collision
make object box 41,40,20,40 : position object 41,95,31,50
make object collision box 41,-20,-10,-20,20,10,20,0
set shadow shading on 41
rem create a crate for automatic collision
make object cube 61,15
automatic object collision 61,8.0,0
set object collision to spheres 61
position object 61,-75,30,75
set shadow shading on 61
rem setup camera and lights
set point light 0,0,0,0
make light 1 : set point light 1,0,0,0 : color light 1,255,-100,-100
position camera 0,30,-100
rem set automatic collision for camera
automatic camera collision 0,15,0
set global collision on
rem loop
do
rem move crate to test automatic object collision
yrotate object 61,wrapvalue(object angle y(61)-0.2)
move object down 61,0.5
move object 61,0.5
if object in screen(41)=1 then center text object screen x(41),object screen y(41)-25,"Sliding Box Collision"
if object in screen(61)=1 then center text object screen x(61),object screen y(61)-25,"Automated Collision"
rem Add gravity to camera to test automatic collision
position camera camera position x(),camera position y()-1.01,camera position z()
rem rectangle roamer
move object 41,0.3
ballhit=object collision(41,0)
if ballhit>0
spin#=rnd(45)
ax#=object position x(41)-get object collision x()
ay#=object position y(41)-get object collision y()
az#=object position z(41)-get object collision z()
position object 41,ax#,ay#,az#
endif
if spin#>0
spin#=spin#-1.0
yrotate object 41,wrapvalue(object angle y(41)+1)
endif
rem move default light with ball
position light 0,object position x(1),object position y(1),object position z(1)
rem move coloured light with roamer
position light 1,object position x(41),object position y(41)+25,object position z(41)
gosub _camera
rem update screen
sync
rem end loop
loop
_camera:
rem Read W,A,S,D keys for movement
tkeystate17=keystate(17)
tkeystate31=keystate(31)
tkeystate30=keystate(30)
tkeystate32=keystate(32)
rem Store CURRENT camera position
cox#=camera position x()
coy#=camera position y()
coz#=camera position z()
rem Determine camera direction
movement=0
if tkeystate17=1
if tkeystate30=1
y#=315 : movement=1
else
if tkeystate32=1
y#=45 : movement=1
else
y#=0 : movement=1
endif
endif
else
if tkeystate31=1
if tkeystate30=1
y#=225 : movement=1
else
if tkeystate32=1
y#=135 : movement=1
else
y#=180 : movement=1
endif
endif
else
if tkeystate30=1
y#=270 : movement=1
else
if tkeystate32=1
y#=90 : movement=1
endif
endif
endif
endif
if movement=1 then move camera 3.0
position mouse 400,300
cammovex#=mousemovex()*2
cammovey#=mousemovey()*2
camangx#=camera angle x()+cammovey#
camangy#=camera angle y()+cammovex#
if wrapvalue(camangx#)>85 and wrapvalue(camangx#)<180 then camangx#=85.0
if wrapvalue(camangx#)>180 and wrapvalue(camangx#)<275 then camangx#=275.0
rotate camera curveangle(camangx#,camera angle x(),15.0),curveangle(camangy#,camera angle y(),15.0),camera angle z()
return