Include "win.inc"

Screen 1024,768,1

Dim x(1000)  as sys 
Dim y(1000)  as sys 
Dim Xv(1000) as single
Dim Yv(1000) as single
Dim LifeSpan(1000) as sys 
sys Xstart,Ystart,i,bild

Sub ParticleInit()
Xstart = ScreenWidth  /15
Ystart = ScreenHeight /15
For i=0 To 1000
    LifeSpan(i) = Rand(1,600)
    X(i)  = Xstart
    Y(i)  = Ystart
    Yv(i) = Rand(1,4)
    Xv(i) = Rand(1,8) 
Next 
End Sub

ParticleInit
While Key(27)=0
ClsColor 0,0,0
For i=0 To 1000
Oval x(i),y(i),24,24, Rand(64,128),rand(128,255),255
x(i)  = x(i) + Xv(i)
y(i)  = y(i) + Yv(i)
Yv(i) = Yv(i) + .4
If y(i) >= ScreenHeight  
   Yv(i) = Yv(i)-Yv(i) * Rand(2,16) /10   
   y(i)  = ScreenHeight
End iF
LifeSpan(i) = LifeSpan(i) -1
If LifeSpan(i) <=0 
   LifeSpan(i) = Rand(1,600)
   x(i)  = Xstart
   y(i)  = Ystart
   Yv(i) = Rand(1,4)
   Xv(i) = Rand(1,8) 
End iF
Next 
SetText 300,16,"COOL WATER",128,128,Rand(64,255)
Flip
SetFps 60
Wend
Ends  