Ok I know that this is not what you are torquing about but I fort I would post it anyway,
its a bit old, and I have not done anything to it for about 5 years,
but it should be ok, it doesn't have any dark physics in it, but dose have a primitive gravity, and floor force.
sync on
sync rate 100
cls
make matrix 1,10000,10000,255,255
position matrix 1,-5000,0,-5000
update matrix 1
`*** player object ***
knight = 1
make object cube knight,5
yrotate object knight,180
scale object knight,100,100,100
position object knight,0,25,0
color object knight,rgb(255,0,0)
fix object pivot knight
o3x#=-1*(object size x(knight)/2)
o3y#=-1*(object size y(knight)/2)
o3z#=-1*(object size z(knight)/2)
o4x#=object size x(knight)/2
o4y#=object size y(knight)/2
o4z#=object size z(knight)/2
MAKE OBJECT COLLISION BOX knight,o3x#,o3y#,o3z#,o4x#,o4y#,o4z#,0
`*** make CAMERA object ***
camOBJ = 2
make object sphere camOBJ,1
scale object camOBJ,300,300,300
position object camOBJ,0,10,-20
hide object camOBJ
o1x#=-1*(object size x(camOBJ)/2)
o1y#=-1*(object size y(camOBJ)/2)
o1z#=-1*(object size z(camOBJ)/2)
o2x#=object size x(camOBJ)/2
o2y#=object size y(camOBJ)/2
o2z#=object size z(camOBJ)/2
MAKE OBJECT COLLISION BOX camOBJ,o1x#,o1y#,o1z#,o2x#,o2y#,o2z#,0
`*** make object floor ***
floor1 = 3
make object cube floor1,5
scale object floor1,1000,75,1000
position object floor1,0,10,0
o5x#=-1*(object size x(floor1)/2)
o5y#=-1*(object size y(floor1)/2)
o5z#=-1*(object size z(floor1)/2)
o6x#=object size x(floor1)/2
o6y#=object size y(floor1)/2
o6z#=object size z(floor1)/2
MAKE OBJECT COLLISION BOX floor1,o5x#,o5y#,o5z#,o6x#,o6y#,o6z#,0
`*** make objrct steps ***
steps = 4
for c = steps to 8
make object cube c,5
next c
`*** make steps ***
for c = steps to 8
scale object 4,1250,75,1250
position object 4,0,8,0
scale object 5,1500,75,1500
position object 5,0,6,0
scale object 6,1750,75,1750
position object 6,0,4,0
scale object 7,2000,75,2000
position object 7,0,2,0
scale object 8,2250,75,2250
position object 8,0,0,0
o7x#=-1*(object size x(c)/2)
o7y#=-1*(object size y(c)/2)
o7z#=-1*(object size z(c)/2)
o8x#=object size x(c)/2
o8y#=object size y(c)/2
o8z#=object size z(c)/2
MAKE OBJECT COLLISION BOX c,o7x#,o7y#,o7z#,o8x#,o8y#,o8z#,0
next c
objsize# = 8.0
`*** grav stings ***
P# AS FLOAT=2.0
N# AS FLOAT=5.2
M# AS FLOAT=objsize#
speed = 0
do
`*** grav object ***
if spacekey()=1 then P#=P#-20
if returnkey()=1 then P#=P#+10
`if spacekey()=0 and returnkey()=0 and landing = 1 then P#=2.0
if scancode()=2 then position object knight,0,object position y(camOBJ),0
`*** rotate object ***
if rightkey()=1 then yrotate object knight,wrapvalue(object angle y(knight)+0.5)
if leftkey()=1 then yrotate object knight,wrapvalue(object angle y(knight)-0.5)
`*** UP speed ***
if downkey() = 0
if upkey()>0 then spON = 1
if spON = 1 then speed=speed + 1
if spON = 2 then speed=speed - 1
if speed > 99 then spON = 2
if speed < 0 then spON = 0
if spON = 0 then speed = 0
if spON = 1 or spON = 2 and upkey() = 0 then spON = 0
endif
move object knight,1*speed
`*** DOWN speed ***
if upkey() = 0
if downkey()>0 then spOFF = 1
if spOFF = 1 then speed1=speed1 - 1
if spOFF = 2 then speed1=speed1 + 1
if speed1 < -99 then spOFF = 2
if speed1 > 0 then spOFF = 0
if spOFF = 0 then speed1 = 0
if spOFF = 1 or spOFF = 2 and downkey() = 0 then spOFF = 0
endif
move object knight,1*speed1
`************************************
`*** camera object ***
camOBJx#=object position x(camOBJ)
camOBJy#=object position y(camOBJ)
camOBJz#=object position z(camOBJ)
position object camOBJ,camOBJx#,camOBJy#,camOBJz#
position camera camOBJx#,camOBJy#,camOBJz#
`*** camera position ***
camhit=object collision(camOBJ,0)
if camhit>0
camOBJx#=object position x(camOBJ)-get object collision x()
camOBJy#=object position y(camOBJ)-get object collision y()
camOBJz#=object position z(camOBJ)-get object collision z()
position object camOBJ,camOBJx#,camOBJy#,camOBJz#
endif
`*** cam land on ***
top2=object collision(camOBJ,0)
if top2>0
hight1=0
camOBJy#=object position y(camOBJ)+P#*N#/M#^2
position object camOBJ,camOBJx#,camOBJy#,camOBJz#
endif
`*************************************************
`*** player object position ***
knightx#=object position x(knight)
knighty#=object position y(knight)-P#*N#/M#^2
knightz#=object position z(knight)
`knighty100#=get ground height(1,knightx#,knightz#)+50
position object knight,knightx#,knighty#,knightz#
`*** player object collision ***
hit=object collision(knight,0)
if hit>0
knightx#=object position x(knight)-get object collision x()
knighty#=object position y(knight)-get object collision y()
knightz#=object position z(knight)-get object collision z()
position object knight,knightx#,knighty#,knightz#
endif
`*** player land on ***
top1=object collision(knight,0)
if top1>0
hight1=0
landing = 0
knighty#=object position y(knight)+P#*N#/M#^2
position object knight,knightx#,knighty#,knightz#
endif
`*******************************************************
`if hit <= 0 or knighty# <= get ground height(1,knightx#,knightz#) and spacekey()<1 and returnkey()<1 then landing = 1
`if hit >0 or knighty# > get ground height(1,knightx#,knightz#) and spacekey()>0 and returnkey()>0 then landing = 2
`speed#=speed
remstart
if knighty# >= 25 and knighty# < 49 and landing = 0 then landing = 1
if knighty# >= 50 and knighty# < 74 and landing = 1 then landing = 2
if knighty# >= 75 and knighty# < 99 and landing = 2 then landing = 3
if knighty# >= 100 and knighty# < 124 and landing = 3 then landing = 4
if knighty# >= 125 and knighty# < 149 and landing = 4 then landing = 5
if knighty# >= 150 and landing = 5 then landing = 6
if landing = 1 then N#=8.2 :P#=8.0
if landing = 2 then N#=11.2 :P#=11.0
if landing = 3 then N#=15.2 :P#=15.0
if landing = 4 then N#=17.2 :P#=17.0
if landing = 5 then N#=19.2 :P#=19.0
if landing = 6 then N#=20.2 :P#=20.0
remend
if landing = 0 then N#=5.2 :P#=2.0
`*******************************************************
`*** this is for ground height on a matrix ***
if knighty# <= get ground height(1,knightx#,knightz#)+3
landing = 0
knighty#=3+get ground height(1,knightx#,knightz#)+P#*N#/M#^2
position object knight,knightx#,knighty#,knightz#
endif
`*******************************************************
`*** camera position ***
camposition#=sqrt((knightx# - camOBJx#)^2 +(knighty# - camOBJy#)^2 + (knightz# - camOBJz#)^2)
`point object camOBJ,knightx#,knighty#,knightz#
set camera to object orientation camOBJ
if mouseclick()=1 then move object camOBJ,1
`backwards (s)
if mouseclick()=2 then move object camOBJ,-1
x# = object position x(camOBJ)
z# = object position z(camOBJ)
y# = object position y(camOBJ)
`camera position y()get ground height(1,x#,z#)+15
rem camera rotation
yrotate object camOBJ,object angle y(camOBJ) + mousemovex()*0.3
xrotate object camOBJ,object angle x(camOBJ) + mousemovey()*0.3
rem stops mouse from going upside down
if wrapvalue(object angle x(camOBJ))>40 and wrapvalue(object angle x(camOBJ))<180 then xrotate object camOBJ,40
if wrapvalue(object angle x(camOBJ))>180 and wrapvalue(object angle x(camOBJ))<280 then xrotate object camOBJ,280
rem camera position
position object camOBJ,x#,y#,z#
`if camposition# > 0 and camposition# < 49 then move object camOBJ,-1
`if camposition# > 50 then move object camOBJ,1
`********************************************************
sync
loop
hope it is of some uses to some one.
From the dark and in to the light, twisted the body of madness, dark souls to only the one who would be called, Death lord of the dead, king of the forgotten, keep of lost souls.