I use DBPro therefore my code is tested and works for dbpro and I have no idea if it will work for Db or not.
For movement of the object I use this function
function positionobject(object#)
if keystate(17)=1 then move object object#,1
if keystate(30)=1 then inc obj_ang# : yrotate object object#,wrapvalue(obj_ang#)
if keystate(31)=1 then move object object#,-1
if keystate(32)=1 then dec obj_ang# : yrotate object object#,wrapvalue(obj_ang#)
endfunction
You will need to declare obj_ang# as global or else the object will not rotate.
For printing the information of the object I use this function
function objectinfo(object#)
set cursor 0,0
if keystate(59)=1
print "press W to move the object fowards"
print "press A to turn the object left along its y axis"
print "press S to turn the object right along its y axis"
print "press D to move the object backwards"
print "press the up arrow to move the camera fowards"
print "press the down arrow to move the camera backwards"
print "press the left arrow to turn the camera left"
print "press the right arrow to turn the camera right"
print "press page up to move the camera up"
print "press page down to move the camera down"
else
print "xpos " +str$(object position x (object#))
print "ypos " +str$(object position y (object#))
print "zpos " +str$(object position z (object#))
print "y rotation " +str$(object angle y (object#))
endif
endfunction
For moving the camera I use this function
function camera(cam#)
if upkey()=1 then move camera cam#,1
if downkey()=1 then move camera cam#,-1
if leftkey()=1 then dec cam_ang# : yrotate camera cam#,cam_ang#
if rightkey()=1 then inc cam_ang# : yrotate camera cam#,cam_ang#
if keystate(201)=1 then inc camheight# : position camera cam#,camera position x(cam#),camheight#,camera position x(cam#)
if keystate(209)=1 then dec camheight# : position camera cam#,camera position x(cam#),camheight#,camera position x(cam#)
endfunction
You will need to declare cameraheight# and cam_ang# as global
This works when getting the correct x and z position for the object when the object dosen't need to be moved up or down. If needed I can modify my functions to do so.
Aku Soku Zan