Here is another way you could do it:
set display mode 1024, 768, 32
sync on
sync rate 60
set camera FOV 45
autocam off : hide mouse
backdrop on
color backdrop rgb(0, 0, 0)
make object cube 1, 5
ink rgb(255, 255, 255), rgb(255, 255, 255)
distance# = 0.0
xMove# = 0.0
yMove# = 0.0
zMove# = 0.0
angleX# = 0.0
angleY# = 0.0
position camera 0, 0, -120
rotate camera 0,0,0
do
cay# = camera angle y() : cax# = camera angle x()
CamX# = camera position x() : CamY# = camera position y() : CamZ# = camera position z()
text 0, 0, "Camera angle y :" + str$(cay#,0)
text 0, 20, "Camera angle x :" + str$(cax#,0)
mc = mouseclick() : sv# = 0.0
cay# = cay# + (mousemovex() * 0.3) : yrotate camera cay#
cax# = cax# + (mousemovey() * 0.3) : xrotate camera cax#
if mc = 1 then sv# = 1.0
if mc = 2 then sv# = -1.0
if mc = 1 or mc = 2
CamX# = newxvalue(CamX#,cay#,sv#)
CamZ# = newzvalue(CamZ#,cay#,sv#)
position camera CamX#,CamY#,CamZ#
endif
sync
loop
So many games to code.......so little time.