
-----------------------------------
Flashkicks
Thu Apr 22, 2004 8:20 am

Direction Change via Mousewhere [snow]
-----------------------------------
Hi~Flashkicks here! I am writing this program for snow as it looked fun; and I am trying to make it so that once you click once- the snow will blow to the right. If you click again; the snow will blow to the left. And keep switching with this pattern.  For some reason I can Not get it so that it detects the SECOND time the mouse is clicked.. Take a look at my coding and if you think you can help-please do.  BTW- The snow is supposed to start off in ALL directions- so that is Not a glitch..

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 (-5, 5)
end for

loop
    mousewhere (mx, my, mb)
    cls
    drawfillbox (0, 0, maxx, maxy, 7)
    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 mb = 1 and change = false then
            change := true
            click := 1
        end if
        if mb = 0 and change = true then
            change := false
            click := 2
        end if
        if click = 1 then
            snow (i).dx := 5
        elsif click = 2 then
            snow (i).dx := -5
        end if

        if snow (i).y 