There's two ways you could do it.
Like This: (The Trig Way)
Sync On : Sync Rate 30
Make Matrix 1,1000,1000,20,20
Randomize Matrix 1,20
Make Object Sphere 1,3
Do
If DownKey()=1 Then Move Object 1,-5
If UpKey()=1 Then Move Object 1,5
If RightKey()=1 Then Turn Object Right 1,5
If LeftKey()=1 Then Turn Object Left 1,5
Cam_XPos#=NewXValue(Object Position X(1),Object Angle Y(1),0-50)
Cam_ZPos#=NewZValue(Object Position Z(1),Object Angle Y(1),0-50)
Cam_YPos#=Get Ground Height(1,Cam_XPos#,Cam_ZPos#)+5
Rotate Camera 0,Object Angle Y(1),0
Position Camera Cam_XPos#,Cam_YPos#,Cam_ZPos#
Sync
Loop
Or Like This: (The Easy Way, No Trig)
Sync On : Sync Rate 30
Make Matrix 1,1000,1000,20,20
Randomize Matrix 1,20
Make Object Sphere 1,3
Do
If DownKey()=1 Then Move Object 1,-5
If UpKey()=1 Then Move Object 1,5
If RightKey()=1 Then Turn Object Right 1,5
If LeftKey()=1 Then Turn Object Left 1,5
Px=Object Position X(1)
Pz=Object Position Z(1)
Py=Get Ground Height(1,Px,Pz)+3
PAy=Object Angle Y(1)
Position Object 1,Px,Py,Pz
Set Camera To Follow Px,Py,Pz,PAy,20,Py+10,20,0
Sync
Loop
To learn what parammeters the "Set Camera To Follow" needs just look in the DB help menu.
Then if you wanted you could add staffing and stuff too. Hope that helps