
-----------------------------------
Flashkicks
Mon Apr 26, 2004 10:49 am

Billy's Snow
-----------------------------------
This is a program I made with some help via Delta and ideas from other Compsci Members..  It is just snow falling down- However; you can click with the mouse to change its direction..  I wanted it to be so that the direction FOLLOWS the direction of the mouse. View.Set ("offscreenonly") 
var mx, my, mb : int 
var change : boolean := false 
var click : int := 0 
type snowDrop : 
    record 
        x : int 
        y : int 
        size : int 
        spd : int 
        dx : int 
    end record 

var snow : array 1 .. 100 of snowDrop 

for i : 1 .. 100 
    snow (i).x := Rand.Int (0, maxx) 
    snow (i).y := Rand.Int (maxy, maxy + 100) 
    snow (i).size := Rand.Int (1, 3) 
    snow (i).spd := -1 - snow (i).size 
    snow (i).dx := Rand.Int (-2-snow(i).size, 2+snow(i).size) 
end for 

loop 
    mousewhere (mx, my, mb) 
    cls 
    drawfillbox (0, 0, maxx, maxy, 7) 
            if mb = 0 and change = true then 
            change := false 
        elsif mb = 1 and change = false then 
            change := true 
            if click = 1 then 
                click := 2 
            elsif click = 2 then 
                click := 3 
            elsif click = 3 then 
                click := 1 
            else 
                click := 1 
            end if 
            for i : 1 .. 100 
                if click = 1 then 
                    
                    snow (i).dx := 2 + snow(i).size 
                elsif click = 2 then 
                    snow (i).dx := -2 - snow(i).size 
                elsif click = 3 then 
                    
                    snow (i).dx := Rand.Int (-2-snow(i).size, 2+snow(i).size) 
                end if 
            end for 
        end if 
    for i : 1 .. 100 
        drawfilloval (snow (i).x, snow (i).y, snow (i).size, snow (i).size, 7) 
        snow (i).x += snow (i).dx 
        snow (i).y += snow (i).spd 
        drawfilloval (snow (i).x, snow (i).y, snow (i).size, snow (i).size, 0) 
        if snow (i).y 