Here's some code that demonstrates howto do sliding collision using dbpro's built in commands. Unfortunately it is no good if any of the objects in your world are rotated, although setting a flag of 1 on make collision box command 'should' allow this but it dont work too well. To see this code in action see 'return to phobos' game in 20 line challenge. It is a doom type game with really good sliding collision, with steps and all sorts!
sync on : sync rate 0 : autocam off
make object cube 1,10 : color object 1,rgb(255,0,0)
make object cube 100,2 : glue object to limb 100,1,0 : position object 100,0,5,5
set object collision off 100
make object collision box 1,-5,-5,-5,5,5,5,0
make object cube 2,10
make object collision box 2,-5,-5,-5,5,5,5,0
make object cube 3,10
make object collision box 3,-5,-5,-5,5,5,5,0
position object 3,15,0,10
make object box 4,6,10,200
make object collision box 4,-3,-5,-100,3,5,100,0
position object 4,-20,0,0
position object 1,0,0,-20
position camera 0,40,-60 : point camera 0,0,0
j#=0.2 : k#=1
make camera 1 : set camera view 1,0,0,100,100
do
if upkey() then move object 1,j#
if downkey() then move object 1,-j#
if leftkey() then yrotate object 1,wrapvalue(object angle y(1)-k#)
if rightkey() then yrotate object 1,wrapvalue(object angle y(1)+k#)
c = object collision(1,0)
if c > 0
x#=object position x(1)-get object collision x()
y#=object position y(1)-get object collision y()
z#=object position z(1)-get object collision z()
position object 1,x#,y#,z#
text 0,0,"COLLISION WITH "+str$(c)
endif
position camera 1,object position x(1),object position y(1),object position z(1)
rotate camera 1,object angle x(1),object angle y(1),object angle z(1)
sync
loop
If your mansion house needs haunting, just call Rentaghost!