Microsoft Small Basic

Program Listing: WNR579
GraphicsWindow.Show()

aantal=180
minradius=10
extraradius=30
speed=4
timestep=10

GraphicsWindow.BrushColor="blue"
GraphicsWindow.FillRectangle(0,0,GraphicsWindow.Width,GraphicsWindow.Height)
GraphicsWindow.BrushColor="white"
GraphicsWindow.PenColor="white"

create()

' nu begint de wolk te bewegen
while "true"
For i=1 To aantal
z=math.GetRandomNumber(100)/500+0.95
Shapes.zoom(cirkel[i],z,z)
makenew=0
if Shapes.GetLeft(cirkel[i])>800 then
makenew=1
endif

dx=Shapes.GetLeft(cirkel[i])+math.GetRandomNumber(5)-3+speed

dy=Shapes.GetTop(cirkel[i])+math.GetRandomNumber(5)-3

Shapes.move(cirkel[i],dx,dy)


endfor

If makenew=1 Then
Destroy()
create()
endif

Program.Delay(timestep)
EndWhile

Sub create
' maak cirkels
For i=1 To aantal
d=math.GetRandomNumber(extraradius)+minradius
cirkel[i]=Shapes.AddEllipse(d,d)
dx=-300+math.GetRandomNumber(200)
dy=200+math.GetRandomNumber(100)
Shapes.Move(cirkel[i],dx,dy)
endfor
endsub

Sub Destroy
for i=1 to aantal
Shapes.Remove(cirkel[i])
endfor
endsub