Have a look to this code.
cheers.
`===============================================
` COLISIONES DESLIZANTES CON UN SOLO OBJETO
` Nuevo-metodo2.dba 19-Noviembre 2001
`===============================================
hide mouse
autocam off
sync on
load bitmap \"brick19.bmp\",1
get image 1,0,0,100,100
delete bitmap 1
`creamos al protagonista
make object cylinder 1,100
scale object 1,12,15,12
position object 1,450,20,700
color object 1,rgb(5,5,200)
`creamos el objeto sensor para ver si toca el suelo
make object cylinder 21,100
scale object 21,20,5,20
position object 21,450,0,700
color object 21,rgb(225,255,120)
`creamos el objeto sensor para ver la altura del escalon
make object cylinder 10,100
ghost object on 10
scale object 10,25,20,25
color object 10,rgb(20,200,120)
`creamos escalones
make object box 100,40,13,50
position object 100,1120,95,500
texture object 100,1
make object box 101,40,13,50
position object 101,1108,104,500
texture object 101,1
`cargamos un escenario 3ds
`y lo hacemos estatico para ganar velocidad
load object \"101.3ds\",777
scale object 777,40,40,40
position object 777,700,-10,100
make static object 777
delete object 777
load mesh \"101.3ds\",1
make object 777,1,0
scale object 777,40,40,40
position object 777,700,-10,100
delete mesh 1
hide object 777
set object collision to polygons 777
rem load object \"ver.3ds\",80
rem position object 80,600,200,100
rem set object collision to polygons 80
rem scale object 80,200,200,200
`definimos la posision de partida
`===============================
x#=800
z#=300
gira#=45
sube#=30
avance=4
gravedad=5
`================================
control:
oldx#=x#
oldz#=z#
`controlamos la vista de camara
gira#=wrapvalue(gira#+mousemovex()*0.7)
cam#=wrapvalue(cam#+mousemovey()*0.7)
rotate camera cam#,0,0
`limitamos el subir y bajar la cabeza(vista de camara)
if cam#<=290 and cam#>180 then cam#=290
if cam#>=70 and cam#<180 then cam#=70
rem adelantamos o atrasamos al dumy
if upkey()=1 THEN x#=NEWXVALUE(x#,gira#,avance)
if upkey()=1 then z#=NEWZVALUE(z#,gira#,avance)
if downkey()=1 THEN x#=NEWXVALUE(x#,gira#,0-avance)
if downkey()=1 then z#=NEWZVALUE(z#,gira#,-5)
if spacekey()=1 then sube#=sube#+8
`nos desplazamos lateralmente a la izquierda
if leftkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,avance)
if leftkey()=1 then z#=NEWZVALUE(z#,gira#-90,avance)
`nos desplazamos lateralmente a la derecha
if rightkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,0-avance)
if rightkey()=1 then z#=NEWZVALUE(z#,gira#-90,0-avance)
rem Actualizar posiciĆ³n del objeto y de la camara
POSITION OBJECT 1,x#,sube#-3,z#
POSITION OBJECT 10,x#,16+sube#,z#
POSITION OBJECT 21,x#,-14+sube#,z#
position camera x#,sube#+20,z#
rem position camera 600,200,600
yrotate camera gira#
rem position camera 600,10,800
`habilitamos una tecla para subir(para crear el nivel solamente)
if inkey$()=\"t\" then sube#=sube#+7
`condiciones de choque para hacer subir al objeto
if object collision(1,0)>0 then p#=1 else p#=0
if object collision(10,0)>1 then p2#=1 else p2#=0
if object collision(21,0)>0 then toca_suelo#=1 else toca_suelo#=0
if toca_suelo#=0 and p#=0 then sube#=sube#-gravedad
if p#=1 and p2#=0 then sube#=sube#+2
if p#=1 then sube#=sube#+2
if p#=1 then color object 1,rgb(100,200,0)
if p#=0 then color object 1,rgb(1,0,200)
rem hide object 1:hide object 10:hide object 21
`DETECCION DE COLISIONES DESLIZANTES
if object collision(10,0)>0
POSITION OBJECT 1,x#,sube#-3,oldz#
POSITION OBJECT 10,x#,16+sube#,oldz#
POSITION OBJECT 21,x#,-14+sube#,oldz#
if object collision(10,0)=0
z#=oldz#
endif
endif
if object collision(10,0)>0
POSITION OBJECT 1,oldx#,sube#-3,z#
POSITION OBJECT 10,oldx#,16+sube#,z#
POSITION OBJECT 21,oldx#,-14+sube#,z#
if object collision(10,0)=0
x#=oldx#
endif
endif
if object collision(10,0)>0
x#=oldx#
z#=oldz#
endif
return
do
gosub control
sync
loop
learning every day