if you use bsp collision is pretty easy, i have some simple collision stuff and a complex gravity with jumping version
simple (no jump):
sync on : sync rate 0
do
if upkey()=1 then move_camera_forwards(0.03)
if downkey()=1 then move_camera_backwards(0.03)
if leftkey()=1 then strafe_camera_left()
if rightkey()=1 then strafe_camera_right()
pitch#=pitch#+mousemovey()
if pitch#>70 then pitch#=69
if pitch#<-70 then pitch#=-69
xrotate camera pitch#
turn#=turn#+mousemovex()
yrotate camera turn#
gravity()
sync
loop
function strafe_camera_left()
yrotate camera (camera angle y(0)+90)
xcam#=camera angle x(0)
xrotate camera (180)
move camera 0.03
xrotate camera xcam#
yrotate camera (camera angle y(0)-90)
endfunction
function strafe_camera_right()
yrotate camera (camera angle y(0)-90)
xcam#=camera angle x(0)
xrotate camera (180)
move camera 0.03
xrotate camera xcam#
yrotate camera (camera angle y(0)+90)
endfunction
function move_camera_forwards(move_speed#)
xcam#=camera angle x()
xrotate camera (185)
move camera 0, -(move_speed#)
xrotate camera 0,xcam#
endfunction
function move_camera_backwards(move_speed#)
xcam#=camera angle x()
xrotate camera (175)
move camera 0,move_speed#
xrotate camera xcam#
endfunction
function gravity()
position camera camera position x(), camera position y()-0.03, camera position z()
endfunction
this sets the camera to point just up slightly them moves it forwards so it goes forwards and up a little, then the gravity pulls it back to the ground. this allows it to go up slopes or stairs, if you want a look at the more complicated example it'll be in the codebase soon but it relies on a collision system stopping the camera going through the level, it is only for moving along the floor on the level but also being able to go up stairs, it goes along the floor even when you look up.
http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.