Thursday, October 27, 2011

Drawing 2




int rw =10;
int rh =10;
int diam =10;
float a = 200;

void setup(){

size (720,720);
frameRate(5);
smooth();
background(180);
stroke(0);
strokeWeight(10);
fill(255,1);

}

void draw(){
  a = a - 2;
  if (a < 0) {
    a = height;
  }
  line(0, a, width, a);
    if (mousePressed == false){
  if (rw<=width){
rect(a,a,rw,rh);
rw+=10;
rh+=10;
}
}
if (mousePressed == true){
  if (diam<height){
    ellipse(mouseX, mouseY, diam, diam);
diam+=10;
  }
}
}


I did not really know what I was supposed to do so I made my drawing draw itself. It is completely different every time you run the program. when you click a ellipse radiates out from where click and a rect radiates from a point 200,200 to 0.0 and a line moves from 200,200 to the top.

No comments:

Post a Comment