To do it in 2D, you have to change z for y, and you will have movemens x,y. Something like this piece of code. you can make some changes
autocam off
sync on
ink rgb(200,0,0),0
box 0,0,10,10
get image 1,0,0,10,10,1
for i= 1 to 100
sprite i,rnd(200),rnd(200),1
next i
position camera 0,800,0
point camera 0,0,0
do
for i= 1 to 100
x=sprite x(i)
y=sprite y(i)
if rnd(1100)=2 then rotate sprite i,45
if rnd(1100)=3 then rotate sprite i,90
if rnd(1100)=8 then rotate sprite i,180
if rnd(1100)=10 then rotate sprite i,270
if x<0 then rotate sprite i,90
if x>300 then rotate sprite i,-90
if y<0 then rotate sprite i,180
if y>300 then rotate sprite i,0
move sprite i,0.1
next i
sync
loop
Edited- In order the sprite rotate correctly, we have to offset sprite....
autocam off
sync on
ink rgb(200,0,0),0
box 0,0,3,10
get image 1,0,0,10,10,1
for i= 1 to 20
sprite i,rnd(200),rnd(200),1
offset sprite i,1.5,5
next i
position camera 0,800,0
point camera 0,0,0
do
for i= 1 to 20
x=sprite x(i)
y=sprite y(i)
if rnd(5000)=2 then rotate sprite i,45
if rnd(5000)=3 then rotate sprite i,90
if rnd(5000)=8 then rotate sprite i,180
if rnd(5000)=10 then rotate sprite i,270
if x<10 then rotate sprite i,90
if x>200 then rotate sprite i,-90
if y<10 then rotate sprite i,180
if y>200 then rotate sprite i,0
move sprite i,0.1
next i
sync
loop
cheers.
I'm not a grumpy grandpa