
-----------------------------------
Delta
Tue Apr 27, 2004 11:56 am

[Source]SnowFlake Program (Mouse)
-----------------------------------
Here is the snowflake program that reacts to the movement of the mouse in the fCount to something smaller (not too small otherwise the program looks like crap).

% Blizzard dependant upon the mouse movement/placement
View.Set ("offscreenonly,nobuttonbar")

type flakes :
    record
        x : int % [x] position
        y : int % [y] position
        dX : int % Direction [x]
        size : int % Size of snow flake [1,2, or 3]
    end record

var fCount : int := 800 % Change to set the number of snowflakes
var mX, mY, mB : int := 0 % Mouse Coordinates
var snow : array 1 .. fCount of flakes % Create the snowflakes

procedure RandomizeValues (count : int)
    snow (count).x := Rand.Int (-300, maxx + 300) % Randomize the position [x]
    snow (count).y := Rand.Int (maxy, maxy + 200) % Randomize the position [y]
    snow (count).size := Rand.Int (1, 3) % Randomize the size of the snowflake
    snow (count).dX := Rand.Int (-3,3) % Randomize the direction of the snowflake
end RandomizeValues

% Initialize values
for i : 1 .. fCount
    RandomizeValues (i) % Randomize the values for each snow flake
end for

loop
    Draw.FillBox (0, 0, maxx, maxy, 7)
    for i : 1 .. fCount
        Mouse.Where (mX, mY, mB)
        snow (i).x += snow (i).dX + (mX - maxx div 2) div 150 * snow (i).size % Move the snowflake in its [x] direction
        snow (i).y -= snow (i).size*2 % Move the snowflake downward
        Draw.FillOval (snow (i).x, snow (i).y, snow (i).size, snow (i).size, 25+snow(i).size*2) % Draw the snow flake
        if snow (i).y < 0 then % If the snowflake has reached the ground
            RandomizeValues (i) % Start it over
        end if
    end for
    View.Update
end loop

-----------------------------------
Flashkicks
Tue Apr 27, 2004 12:12 pm


-----------------------------------
Thats nice;) Indeed!!..   But now i have no challenge ahead of me:( :?

-----------------------------------
Paul
Tue Apr 27, 2004 2:20 pm


-----------------------------------
lol very cool, so many snow programs...
I like this one the best  :lol:

-----------------------------------
we64
Wed Apr 28, 2004 12:31 pm


-----------------------------------
cool program..... didn't understand the code....

-----------------------------------
Delta
Wed Apr 28, 2004 3:21 pm


-----------------------------------
Have you read the comments? because if you haven't maybe that'll help you... I'm pretty  sure I commented most of the lines... but ya...

-----------------------------------
MyPistolsIn3D
Thu Apr 29, 2004 1:20 pm

snow
-----------------------------------
Would it be possible to like have other stuff going on while this is in the background? like a menu screen or sumthing like that?

-----------------------------------
Canadian Rob
Thu May 20, 2004 8:55 pm


-----------------------------------
cool

-----------------------------------
the_short1
Mon May 24, 2004 6:41 pm


-----------------------------------
wow delta...  lookz nice.. diferent sizes of snow and all..
suggestion: make them stars isnetad of ovals..

yea i want to make a snowflake program too....
just laking the will power...
