mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-05 04:29:15 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
29 lines
487 B
Plaintext
29 lines
487 B
Plaintext
int W = 400;
|
|
int H = 300;
|
|
int cycle = 0;
|
|
int count = 0;
|
|
void setup() {
|
|
size(W,H);
|
|
background(0);
|
|
smooth();
|
|
};
|
|
void draw(){
|
|
if(cycle > 5) {
|
|
cycle = 0;
|
|
stroke(floor(random(255)),
|
|
floor(random(255)),
|
|
floor(random(255)), 60 );
|
|
};
|
|
if(count > 799) {
|
|
count = 0;
|
|
};
|
|
for (int i = 0; i < 100; i++) {
|
|
float r = random(2);
|
|
strokeWeight(r);
|
|
float offset = r * count;
|
|
line(i-20, H, i+offset, 0);
|
|
}
|
|
cycle++;
|
|
count+=5;
|
|
}
|