Computer Science Canada

Some fancy looking dots.

Author:  Neo [ Tue Nov 16, 2004 5:24 pm ]
Post subject:  Some fancy looking dots.

I was messing around and came up with this by accident.

code:
View.Set ("graphics:300;300,offscreenonly")
const numdots := 2000
var x, y, angle, d, spd : array 1 .. numdots of real
var c := 35

for i : 1 .. numdots
    x (i) := 0.0
    angle (i) := 0.0
    y (i) := 0.0
    angle (i) := 0.0
    d (i) := 0.1 * i
    spd (i) := 0.01 * i
end for

loop
    drawfillbox (0, 0, maxx, maxy, black)
    for i : 1 .. numdots
        x (i) := d (i) * (cos (angle (i))) + (maxx div 2)
        y (i) := d (i) * (sin (angle (i))) + (maxy div 2)
        angle (i) += spd (i)
        drawdot (round (x (i)), round (y (i)), c)
    end for

    if c >= 104 then
        c := 35
    end if
    c += 1

    delay (60)
    View.Update
end loop

Author:  cool dude [ Tue Nov 16, 2004 6:33 pm ]
Post subject: 

wow, thats nice. although i don't understand your code because i wasn't taught cos, and that other stuff yet. good job!

Author:  josh [ Tue Nov 16, 2004 8:10 pm ]
Post subject: 

pretty nice for "just messing around" Very Happy


: