Move canvas

Untitled Sketch

Saved June 7, 2010
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();
}
 
 
 

Unless specified otherwise in the source code, this work, created by
is licensed under a Creative Commons Attribution-Share Alike 3.0 License.

Creative Commons License

Authors

Modify this version

Export this version

Source code
HTML (w/canvas)