Ok, I fixed it partially. However, the character floats up into space.
Can someone help me fix this? Here is the code now.
Rem Project: Collision Demo
Rem Created: 2/9/2007 2:34:49 PM
Rem ***** Main Source File *****
Sync On
Sync Rate 60
Make Object Sphere 1,2
Make Object Box 3,100,6,1
Move Object Down 3,4
Make Object Cube 2,2
Move Object Right 2,6
Set Object Collision on 1
Set Object Collision on 2
Set Object Collision On 3
jumping=0
nonjumping=1
jump#=0.3
Do
oldx=object position x(1)
oldz=object position z(1)
oldy=object position y(1)
Move Object down 1,jump#
if object Collision(1,2)=1 then Position Object 1,oldx,object position y(1),oldz
if object Collision(1,3)=1 and nonjumping = 1 then Position Object 1,object position x(1),oldy,Object position z(1)
If leftkey()=1 then move object left 1,0.1
If rightkey()=1 then move object right 1,0.1
Position Camera object position x(1), camera position y(),-12
if upkey()=1 and jumping = 0
jumping=1
nonjumping=0
endif
if jumping=1 and nonjumping=0
jump#=0
dec jump#, 0.1
endif
if jump#=-1
inc jump#, 0.1
nonjumping=1
endif
if jump#=0.29
jump#=0.3
jumping=0
endif
Sync
Loop