do
Rem Store Object angle Y in aY#
aY# = Object angle Y(1)
Rem Control input for camera
If Upkey()=1 then Move object 1,-10+1
If Leftkey()=1 then Yrotate object 1,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 1,Wrapvalue(aY#+5)
Rem get player object position and store in X# and Z#
X# = Object position x(1)
Z# = Object position z(1)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-0,100)
cX# = Newxvalue(X#,aY#-0,100)
Rem position camera
Position Camera cX#,100,cZ#
Rem point the camera at the player object
Point camera X#,50,Z#
rem pitch object
if INKEY$()="w" then PITCH OBJECT UP 1,0.1
if INKEY$()="z" then PITCH OBJECT DOWN 1,0.1
if INKEY$()="s" then ROLL OBJECT LEFT 1,0.1
if INKEY$()="a" then ROLL OBJECT RIGHT 1,0.1
Rem Refresh Screen
Sync
rem End loop
loop