So I finally came back to DBpro amd whipped up a FPS Character controller. I've never actually made a character controller this successful on my own before so it probably isnt the best way of doing this but oh well.
Rem Project: FPS Game 2011
Rem Created: Wednesday, July 13, 2011
Rem ***** Main Source File *****
Sync On
Sync Rate 60
Rem Setup our Scene
Rem Test Scene
make object cube 2,5
Position Object 2,0,0,50
Rem Setup Our Player
make camera 1
Rem The Base for our character controller
make object cylinder 1,2
hide object 1
Rem Position Player
Position object 1,0,1,0
//////////////////////////////////////////////////////////////////////////////////////////////
Do
Rem Position Camera to Player
PosCam(px#, py#, pz#)
Rem move player
MovePlayer()
Rem Position Variables
px#= object position x(1)
py#= object position y(1) + 1
pz#= object position z(1)
pr#= object angle y(1)
angx# = camera angle x(1)
Rem Rotate Camera
RotCam(angx#)
Rem Rotate Player
RotPlayer(pr#)
Rem Position Camera to Player
PosCam(px#, py#, pz#)
sync
Loop
//////////////////////////////////////////////////////////////////////////////////////////////
Rem Functions
FUNCTION PosCam(x, y, z)
Position camera 1,x,y,z
ENDFUNCTION
FUNCTION MovePlayer()
if upkey()=1 then move object 1,1
if downkey()=1 then move object 1,-1
if rightkey()=1 then move object right 1,1
if leftkey()=1 then move object left 1,1
ENDFUNCTION
FUNCTION RotCam(x)
xrotate camera 1, x+mousemovey()/3.0
ENDFUNCTION
FUNCTION RotPlayer(y)
yrotate object 1, y+mousemovex()/3.0
yrotate camera 1, y+mousemovex()/3.0
ENDFUNCTION
If you run the code and turn a little and move its quite jumpy.
Any ideas?
I might actually make a FPS game!