rem Moving the camera - OpenDBC tutorial (DarkBASIC Classic) sync on : sync rate 60 autocam off color backdrop rgb(150, 190, 230) rem A floor and a few pillars to walk between make object plain 1, 400, 400 xrotate object 1, 90 color object 1, rgb(70, 120, 70) for n = 2 to 21 make object cylinder n, 8 scale object n, 100, 400, 100 position object n, rnd(300) - 150, 16, rnd(300) - 150 color object n, rgb(200, 180, 150) next n position camera 0, 10, -120 angle# = 0.0 do rem Arrow keys walk and turn if upkey() = 1 then move camera 2 if downkey() = 1 then move camera -2 if leftkey() = 1 then angle# = wrapvalue(angle# - 3) if rightkey() = 1 then angle# = wrapvalue(angle# + 3) rem With no key pressed, the camera strolls on its own if upkey() + downkey() + leftkey() + rightkey() = 0 angle# = wrapvalue(angle# + 0.5) move camera 0.6 endif rem Keep the camera at eye height and facing the right way yrotate camera angle# position camera camera position x(), 10, camera position z() text 10, 10, "Arrow keys: walk and turn" text 10, 30, "X " + str$(int(camera position x())) + " Z " + str$(int(camera position z())) sync loop