rem Physics - OpenDBC tutorial (DarkBASIC Professional) sync on : sync rate 60 autocam off color backdrop rgb(18, 20, 34) rem The ground and two ramps are static: they never move make object box 1, 120, 2, 80 position object 1, 0, -1, 0 color object 1, rgb(70, 80, 110) make object box 2, 40, 2, 30 position object 2, -20, 18, 0 : zrotate object 2, -20 color object 2, rgb(200, 120, 60) make object box 3, 40, 2, 30 position object 3, 20, 8, 0 : zrotate object 3, 20 color object 3, rgb(200, 120, 60) ode start ode set world gravity 0, -20, 0 for n = 1 to 3 ode create static box n next n rem Balls are dynamic: the physics engine moves them ball = 10 position camera 0, 30, -90 point camera 0, 10, 0 do rem Drop a new ball every half second, up to 30 if timer() - last > 500 and ball < 40 last = timer() make object sphere ball, 4 color object ball, rgb(rnd(155) + 100, rnd(155) + 100, 255) position object ball, -30 + rnd(8), 40, rnd(10) - 5 ode create dynamic sphere ball inc ball endif ode update text 10, 10, "Balls: " + str$(ball - 10) sync loop