Searching SET CAMERA TO FOLLOW brings up this:
Set Camera To Follow Tutorial
Another method could be this:
1) Position the camera where your object is.
2) Y Rotate the camera to your object's Y angle.
3) X Rotate the camera by some angle so it is looking down a little bit
4) Move the camera backwards by some distance using the MOVE CAMERA command. This will set how far away the camera is.
-The camera should follow your object at all times (it won't be as smooth as SET CAMERA TO FOLLOW though)
EDIT: Here is your code with that camera method added:
Rem Project: Dark Basic Pro Project
Rem Created: Saturday, October 30, 2010
Rem ***** Main Source File *****
sync on
sync rate 60
make object cube 1,25
make light 1
set light range 1,90000
make object cube 2,25
load image "Floor.png",2
make matrix 1,1000,1000,50,50
position matrix 1,0,-15,0
prepare matrix texture 1,2,1,1
do
texture object 2,2
position object 2,0,0,0
if rightkey()=1 then turn object right 1,3
if leftkey()=1 then turn object left 1,3
if upkey()=1 then move object 1,3
if downkey()=1 then move object 1,-3
`set some variables (I added the # sign to make them into float values (a.k.a. real numbers that can have decimal points))
X#=object position X(1)
Y#=object position Y(1)
Z#=object position Z(1)
AY#=object angle Y(1)
position camera X#,Y#,Z# `put the camera where the player is
yrotate camera AY# `Yrotating the camera to the player's Y angle
xrotate camera 45 `the camera is looking down a little
move camera -75 `move the camera back a bit
sync
loop
By the way, this:
texture object 2,2
position object 2,0,0,0
Doesn't have to be in the loop. It only needs to happen once since object 2 isn't changing textures or moving anywhere.
I would recommend the SET CAMERA TO FOLLOW command though, it's much better and smoother

Guns, cinematics, stealth, items and more!