Skip navigation

 

Screen Shot from program

Screen Shot from program

Code Below:

 

 

// Q: mixed rectangles& circles(yellow and purple) on navy
// A: red ellipses
// S: green ellipses
// D: pink backqround change from bottom left
// z: orange background change from bottom left
// X: purple circles from bottom left
// C: pink circles from bottom right
// V: restore blue
// B: white background
float fillSize=0;
float fillSizeZ=0;
float fillSizeX=0;
float fillSizeC=0;
float fillSizeF=0;
float fillSizeQ=0;
float location =width/2;
int numCountA= 0;
int numCountS=0;
void setup(){
  background(36,34,121);
  size(500,500);
  smooth();
}
void draw(){
  for (int i=50; i>0; i–){
    numCountS= numCountS + 16;
    if (numCountS > 100000){
      numCountS=0;
    }
  } 
  // V: restore blue
  if (key == ‘v’ || key == ‘V’) {
    background(36,34,121);
  }
  // B:white background
  if (key == ‘b’ || key == ‘B’) {
    background(255, 50);
  }
  for (int i=0; i<50; i++){
    numCountA= numCountA + 16;
    if (numCountA > 100000){
      numCountA=0;
    }
  } 
  //A:red ellipses
  if (key == ‘a’ || key == ‘A’){
    background(36,34,121);
    noFill();
    stroke(255,0,0);
    strokeWeight(6);
    ellipse(random(000,250),random(00,250), numCountA/1000, numCountA/1000);
  }
  // S:green ellipses
  if(key==’s’|| key==’S’){
    background(36,34,121);
    noFill();
    stroke(0,255,0);
    strokeWeight(10);
    ellipse(random(250,500),random(250,500), numCountS/1000, numCountS/1000);
  }
  // D:pink backqround change from bottom left
  if (key ==’d’|| key ==’D’){
    for (int i=0; i<=100; i++){
      fillSize = fillSize +1;
      if (fillSize ==1500|| fillSize >1500){
        fillSize =0;
      }
    }
    fill(239,30,173);
    noStroke();
    ellipse(0,0,fillSize, fillSize);
    println(fillSize);  
  }
  // z:orange background change from bottom left
  if (key ==’z’|| key ==’Z’){
    for (int i=0; i<=100; i++){
      fillSizeZ = fillSizeZ +1;
      if (fillSizeZ ==1500|| fillSizeZ >1500){
        fillSizeZ =0;
      }
    }
    fill(246,155,38);
    noStroke();
    ellipse(0,500,fillSizeZ, fillSizeZ);
    println(fillSizeZ);  
  }
  // X:purple circles from bottom left
  if (key ==’x’|| key ==’X’){
    for (int i=0; i<=100; i++){
      fillSizeX = fillSizeX +.5;
      if (fillSizeX ==1500|| fillSizeX >1500){
        fillSizeX =0;
      }
    }
    noFill();
    strokeWeight(5);
    stroke(165,38,246);
    ellipse(0,400,fillSizeX, fillSizeX);
    println(fillSizeX);  
  }
  //C:pink circles from bottom right
  if (key ==’c’|| key ==’C’){
    for (int i=0; i<=100; i++){
      fillSizeC = fillSizeC +.5;
      if (fillSizeC ==1500|| fillSizeC >1500){
        fillSizeC =0;
      }
    }
    noFill();
    strokeWeight(5);
    stroke(231,12,223);
    ellipse(400,400,fillSizeC, fillSizeC);
    println(fillSizeC);  
  }
  //Q:mixed rectangles& circles(yellow and purple) on navy
  if (key ==’q’|| key ==’Q’){
    for (int i=0; i<=100; i++){
      fillSizeQ = fillSizeQ +1;
      if (fillSizeQ ==50|| fillSizeQ >50){
        fillSizeQ =0;
      }
    }
    noFill();
    strokeWeight(random(0,6));
    stroke(250,252,64);
    background(36,34,121);
    rect(random(0,60),random(0,100),fillSizeQ, fillSizeQ);
    rect(random(80,300),random(130,400),fillSizeQ, fillSizeQ);
    rect(random(300, 350),random(300,350),fillSizeQ, fillSizeQ);
    stroke(149,131,217);
    ellipse(random(0,500),random(0,500),fillSizeQ, fillSizeQ);
    ellipse(random(400,480),random(400,480),fillSizeQ, fillSizeQ);
    ellipse(random(200,400),random(200,175),fillSizeQ, fillSizeQ);
  }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: