Ok, here it is.
set display mode 800,600,32,1
sync on
sync rate 0
position camera 0,0,350,0
distance=100
turnspeed#=1
speed=400
dim hounds#(10,10)
for n=10 to 19
make object cube n,10
make object cube n+10,20
position object n+10,0,0,1000
yrotate object n+10,270
make object cube n+20,20
position object n+20,0,0,0
yrotate object n+20,90
hounds#(n-10,0)=distance+((n-10)*(object size(n)+5))
hounds#(n-10,2)=(rnd(speed)/100)+1
arc#=(hounds#(n-10,0)*3.141)/2
arc2#=(arc#/hounds#(n-10,2))
hounds#(n-10,1)=90/arc2#
next n
do
position camera 0,0,150,-400
point camera 0,0,0
for n=10 to 19
if object position z(n)<=object position z(n+20)
yrotate object n+10,270
yrotate object n+20,wrapvalue(object angle y(n+20)+hounds#(n-10,1))
hounds#(n-10,3)=newxvalue(object position x(n+20),object angle y(n+20),hounds#(n-10,0))
hounds#(n-10,4)=newzvalue(object position z(n+20),object angle y(n+20),hounds#(n-10,0))
yrotate object n,object angle y(n+20)
endif
if object position z(n)>object position z(n+20) and hounds#(n-10,4)<object position z(n+10)
if object angle y(n+20)>90
hounds#(n-10,3)=newxvalue(object position x(n),0,hounds#(n-10,2))
hounds#(n-10,4)=newzvalue(object position z(n),0,hounds#(n-10,2))
endif
if object angle y(n+10)<270
hounds#(n-10,3)=newxvalue(object position x(n),180,hounds#(n-10,2))
hounds#(n-10,4)=newzvalue(object position z(n),180,hounds#(n-10,2))
endif
endif
if object position z(n)=>object position z(n+10)
yrotate object n+10,wrapvalue(object angle y(n+10)+hounds#(n-10,1))
hounds#(n-10,3)=newxvalue(object position x(n+10),object angle y(n+10),hounds#(n-10,0))
hounds#(n-10,4)=newzvalue(object position z(n+10),object angle y(n+10),hounds#(n-10,0))
yrotate object n,object angle y(n+10)
yrotate object n+20,90
endif
position object n,hounds#(n-10,3),y#,hounds#(n-10,4)
next n
sync
loop
That works quite well for a demo. Not sure if it's what you are after but it is a good starting point.