Week 3-2

by Yulong Guo
  • Show Sketch
/** @peep sketchcode */
void setup(){
background(random(255), random(255), random(255));
size(200, 200);
noStroke();
}
void draw(){
  if(mousePressed) {
  if(mouseX>180 && mouseY>180) {
for(int y = 0; y <= 180; y += 10) {
  for(int x = 0; x < y; x += 10) {
      fill(random(255), random(255), random(255));
    rect(x, y, x/10, y/10);
  }
}
}
  }
if(mousePressed) {
  if(mouseX>180 && mouseY>180) {
for(int b = 0; b <= 180; b += 10) {
  for(int c = 200; c > b; c -= 10) {
      fill(random(255), random(255), random(255));
      ellipse(c, b, c/10, b/10);
    }
  }
}
}
} // Display the coloured shapes when clicking the bottom right

Comments

Nobody has said anything yet.