Ok, here's the working code. Added a shadow for the ball too. Slightly buggy, but not sure why (on the shadow). You may have to tweak the settings a little on different speed cpu's, but it should work straight off pretty well. Obviously, ignore the media, although most is provided up above. The tube object I added in to see how it handled it. Basically a 3ds tube, sliced up to just a half tube, it worked perfectly
.
Rem Project: Test1
Rem Created: 04/09/2006 16:31:27
Rem ***** Main Source File *****
phy start
phy set gravity 0,-100,0
set display mode 800,600,16,1
sync on
sync rate 0
set ambient light 50
position light 0,20000,10000,0
set light range 0,20000
load object "wall.x",1
phy make rigid body static mesh 1
load object "floor.x",2
phy make rigid body static box 2
load object "ramp.x",3
phy make rigid body static mesh 3
load object "stairs.x",4
phy make rigid body static mesh 4
load object "base.x",5
phy make rigid body static box 5
load object "smallbox.x",6
phy make rigid body static box 6
load object "longbox.x",7
phy make rigid body static box 7
load image "tube.bmp",8
load object "tube.x",8
texture object 8,8
phy make rigid body static mesh 8
load image "ball.bmp",10
for n=10 to 10
make object sphere n,10
texture object n,10
SET SHADOW SHADING ON n
position object n,0,rnd(150)+160,0
phy make rigid body dynamic sphere n
next n
position camera 0,320,-50
point camera 0,0,0
max=0.5
mode=1
do
if inertiaforward#>max
inertiaforward=max
endif
if inertiasideward#>max
inertiasideward=max
endif
if upkey()=1
phy add rigid body force 10,0,0,15000,mode
endif
if downkey()=1
phy add rigid body force 10,0,0,-15000,mode
endif
if rightkey()=1
phy add rigid body force 10,15000,0,0,mode
endif
if leftkey()=1
phy add rigid body force 10,-15000,0,0,mode
endif
set cursor 0,0
if spacekey()=1 and rep=0
rep=1
phy add rigid body force 10,0,200000,0,mode
endif
if scancode()=0 and rep=1
rep=0
endif
phy update
sync
loop
Check out Project Desert Storm
http://forum.thegamecreators.com/?m=forum_view&t=83458&b=8