/* built with Studio Sketchpad:
* http://sketchpad.cc
*
* observe the evolution of this sketch:
* http://sketchpad.cc/sp/pad/view/ro.R21LMjgi$FG/rev.1620
*
* authors:
* Dominic
*
* sfw
* Dingobloo
* SKETCHPAD ADMIN
* Ari
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* http://creativecommons.org/licenses/by-sa/3.0/
*/
int x = 0;
int y = 0;
int r = 255;
int b = 0;
int g = 0;
int randomy = 0;
int randomx = 0;
void setup() {
size(250, 500);
smooth();
background(100,10,100); //THIS is the start colour
strokeWeight(10);
frameRate(30);
}
void draw() {
fill(155,10,150, 9);//Fill colour of the rect.
rect(0,0,width,height);//"clears" the screen
r = random(0, 200);
stroke(r,g,b,100);//line colour
//line(x,y,x,height); //is this line even doing anything at this point?
x +=random(-20,20);
y +=random(-20,20);
if((x > width) || (x < 0)){
x = random(0,width);
}
if((y>height) || (y<0)){
y=random(0,height);
}
stroke(r,g,0,100);
fill(r,0,g,255);//this fill is the shape fill.
randomy = random(-50, 50);
randomx = random(-50, 50);
int count = random(4, 8);
scale(random(1,3));
beginShape();
for(int i=0;i<count;i++){
randomy = random(-50, 50);
randomx = random(-50, 50);
vertex(x-50-randomx , y-50-randomy );
}
endShape();
}
// Original sketch from http://processingjs.org/learning/basic/random