Posted: 30th Jan 2003 1:01
The following routine can be used to produce cheap snow or rain effects.
You will need my Memory & LinkList module to run it.
Also note it doesn't take into account any objects in the way of the rain, as its a 2D line on top of a 3D screen.

+ Code Snippet
rem The maximum number of droplets
#constant MAX_RAIN   50

#constant POS_X      0
#constant POS_Y      2
#constant POS_XSIZE  4
#constant POS_YSIZE  8
#constant POS_XDIR   10
#constant POS_YDIR   12

Rem Current SNOW or RAIN is allowed
#constant WEATHER_TYPE  "SNOW"

ptr=make memory(1024)
header=linklist_createHeader()
for x=1 to MAX_RAIN
   pokeS ptr,POS_X,rnd(screen width())
   pokeS ptr,POS_Y,rnd(screen height())

   if WEATHER_TYPE="RAIN"
      pokeS ptr,POS_XSIZE,4
      pokeS ptr,POS_YSIZE,4
      pokeS ptr,POS_XDIR,4
      pokeS ptr,POS_YDIR,4
   else
      if WEATHER_TYPE="SNOW"
         pokeS ptr,POS_XSIZE,rnd(4)+1
         pokeS ptr,POS_YSIZE,rnd(4)+1
         pokeS ptr,POS_XDIR,rnd(4)+1
         pokeS ptr,POS_YDIR,rnd(4)+1
      endif
   endif

   node=linkList_AddNode(header,ptr,24,0)
next x

sync on
sync rate 0
autocam on

load object "i:\001.x",1
load object "i:\tank.x",2
set object cull 1,0
set object cull 2,0
position object 1,0.0,0.0,0.0
position object 2,-105.0,0.0,-5.0
position object 2,0.0,0.0,0.0
position camera -10.0,-10.0,-100.0

yrotate object 2,0
set object collision on 1
set object collision on 2
x#=1.0
y#=1.0
z#=1.0
aa=380

rx=0
ry=0
rem FLX_Double_Texturing(1,1,2,80)
rem scale object 2,x#,y#,z#

repeat
   rem This bit does the processing
   node=linkList_GetFirstNode(header)
   while node0
      d=linkList_GetNodeData(node,ptr,24,0)
      _x=peekS(ptr,POS_X)+peekS(ptr,POS_XDIR)
      _y=peekS(ptr,POS_Y)+peekS(ptr,POS_YDIR)
      if _x>screen width() then _x=0-(screen width()-_x)
      if _y>screen height() then _y=0-(screen height()-_y)

      line _x,_y,_
           _x+peekS(ptr,POS_XSIZE),_y+peekS(ptr,POS_YSIZE)

      pokeS ptr,POS_X,_x
      pokeS ptr,POS_Y,_y
      d=linkList_WriteNodeData(node,ptr,24,0)
      node=linkList_GetNextNode(node)
   endwhile

   y#=object angle y(2)
   if upkey()=1 then move object 2,-10
   if downkey()=1 then move object 2,10
   if leftkey()=1 then yrotate object 2,wrapvalue(y#-5.0)
   if rightkey()=1 then yrotate object 2,wrapvalue(y#+5.0)

   set camera to follow object position x(2),_
                        object position y(2),_
                        object position z(2),_
                        wrapvalue(object angle y(2)-180.0),650,aa,10,0

   text 0,0,str$(x#)+" "+str$(y#)+" "+str$(z#)+" "+str$(screen fps())+" "+str$(a#)+" "+str$(object hit(1,0))+" "+str$(object hit(2,0))
   text 0,100,str$(object collision(1,0))+" "+str$(object collision(2,0))+" "+str$(screen fps())
   sync
until escapekey()=1
header=linkList_FreeHeader(header)
delete memory (ptr)
wait key