C'mon, you didn't even wait 2 hours between those posts! Just wait a day or two...
Actually, the collision will probably screw up if you move the camera at an angle. If you do, replace my collision stuff with classic collision. Create walls and have the spheres bounce off of those. For collision examples, look at the ones that come with DB.
This will run as fast as possible while still keeping everything moving at the same speed:
sync on:sync rate 0
hide mouse
randomize timer()
position camera 50,10,90
load object "cell.x",1
position object 1,0,-5,14
i=1
do
if ia=0
ia=1
iz#=0.0
i=i+1
clone object i,1
position object i,object position x(i-1),object position y(i-1),object position z(i-1)
yrotate object i,rnd(360)
endif
if ia=1
iz#=iz#+1.0*speed#
move object i,0.1*speed#
`change 10 to how big your object is /10
if iz#>=10.0 then ia=0
endif
for a=2 to i
if object exist(a)
if object screen x(a)>screen width() or object screen x(a)<0 then yrotate object a,wrapvalue(180-object angle y(a))
if object screen y(a)<0 or object screen y(a)>screen height() then yrotate object a,wrapvalue((180-(object angle y(a)-90))+90)
endif
next a
Yrotate object 1,wrapvalue(object angle y(1)+speed#)
fps#=screen fps()
if fps#<1.0 then fps#=1.0
speed#=60.0/fps#
sync
loop
Xander Moser - Bolt Software - Firewall
