seems the source I posted isn't working so i'll just post it in code tags
`set display mode and turn sync on then set the rate then hide the mouse
set display mode 1024,768,16
sync on : sync rate 0
hide mouse
`load my bsp map
load bsp " ","roomone.bsp"
restart=1
gunObj=2 : load object "mac10.x",GunObj
lock object on GunObj
scale object GunObj,2.5,2.5,2.5
rotate object GunObj,0,250,0
position object GunObj,.5,-1.5,2
disable object zdepth GunObj
`set the camera position
camht=80
set camera range 1,1000
set bsp camera 2
position camera 2,camht,2
autocam off
`do the main loop
do
gosub _control_player
gosub _gravity
`gosub _control_gunandbullet
`gosub _control_enemies
set cursor screen width()/2-315, screen height()/2-235
print "FPS: ", screen fps()
print "y collision ", coly
print "hit ", BSP COLLISION HIT(1)
sync
loop
`control player sub
_control_player:
`incase of restart
if restart=1
restart=0
set bsp collision off 1
rotate camera 0,0,0
position camera 2,camht,2
set bsp camera collision 1,0,2,0
set bsp collision threshhold 1,1
set bsp collision height adjustment 1,75
endif
`player direction
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2),0
`player movement
rem Control player movement
cx#=camera angle x(0) : cy#=camera angle y(0)
if keystate(17) then xrotate camera 0,0 : move camera 0,1.3 : xrotate camera 0,cx#
if keystate(31) then xrotate camera 0,0 : move camera 0,-0.8 : xrotate camera 0,cx#
if keystate(30) then yrotate camera 0,cy#-90 : move camera 0.6 : yrotate camera 0,cy#
if keystate(32) then yrotate camera 0,cy#+90 : move camera 0.6 : yrotate camera 0,cy#
`wrapvalues so the player wont turn upside down
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
return
_gravity:
coly=bsp collision y(1)
hit=bsp collision hit(1)
cx#=camera position x(0)
cy#=camera position y(0)
cz#=camera position z(0)
remstart
the problem here is gravity works until I hit a wall i just want gravity
to work if i dont collide with anything
remend
if coly=0 and hit=0 then position camera cx#,cy#-2,cz#
return
the media in the above post contains all the .x files and .bsp & textures
Intel P4 3.6Ghz
1G PC3200 DDR