> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.5J$nhCJiphw/rev.2608
 * 
 * authors: 
 *   
 *   Lilya Woodburn

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



//PLEASE NOTE: THIS IS STILL A WORK IN PROGRESS

void setup() {
    size(300, 500);
    background(255, 204, 255);
    strokeWeight(3);
}

void draw() {
    
    // Maintenance
    maintCoach(75, 65, 80, color(255), color(255,255,120), color(255,255,0));
    
    // Science
    noStroke();
    fill(0,179,60);
    rectMode(CENTER);
    rect(width*0.75, 65, 22, 70);
    //outer triangle
    pushMatrix();
    translate(width*0.75, height*0.2);
    rotate(PI/6);
    polygon(0, 0, 45, 3, color(0,179,60));
    popMatrix();
    //inner triangle
    pushMatrix();
    stroke(255);
    translate(width*0.75, height*0.2);
    rotate(PI/6);
    polygon(0, 0, 35, 3, color(102, 255, 51));
    popMatrix();
    //center triangle
    pushMatrix();
    stroke(255);
    translate(width*0.75, height*0.2);
    rotate(PI/6);
    polygon(0, 0, 10, 3, color(255));
    popMatrix();
    
    // Creature Room
    stroke(255, 153, 0);
    fill(0,153,51);
    ellipse(75,195,90,90);
    stroke(255);
    fill(255, 153, 0);
    ellipse(75,195,55,55);
    noStroke();
    fill(0,153,51);
    ellipse(75,195,12,55);
    
    // Whistle
    stroke(255);
    fill(191,191,191);
    rectMode(CORNER);
    rect(165,155,60,25);
    maintCoach(230, 195, 80, color(255), color(191,191,191), color(128,128,128));
    
    // Investigation
    noStroke();
    pushMatrix();
    translate(width*0.25, height*0.62);
    polygon(0, 0, 47, 6, color(179,0,0));
    popMatrix();
    //inner hexagon
    stroke(255);
    pushMatrix();
    translate(width*0.25, height*0.62);
    polygon(0, 0, 42, 6, color(255,0,0));
    popMatrix();
    //center hexagon
    pushMatrix();
    translate(width*0.25, height*0.62);
    polygon(0, 0, 20, 6, color(179,0,0));
    popMatrix();
    
    // Management
    noStroke();
    pushMatrix();
    translate(width*0.75, height*0.62);
    rotate(PI/8);
    polygon(0, 0, 47, 8, color(143, 0, 179));
    popMatrix();
    //inner octagon
    stroke(255);
    pushMatrix();
    translate(width*0.75, height*0.62);
    rotate(PI/8);
    polygon(0, 0, 42, 8, color(204, 0, 255));
    popMatrix();
    //off-center octagon
    pushMatrix();
    translate(width*0.735, height*0.63);
    rotate(PI/8);
    polygon(0, 0, 18, 8, color(143, 0, 179));
    popMatrix();
    
    //Security
    pushMatrix();
    noStroke();
    translate(width*0.25, height*0.87);
    rotate(-PI/10);
    polygon(0, 0, 47, 5, color(0,0,255));
    popMatrix();
    //inner pentagon
    pushMatrix();
    stroke(255);
    translate(width*0.25, height*0.87);
    rotate(-PI/10);
    polygon(0, 0, 42, 5, color(128, 170, 255));
    popMatrix();
    //center pentagon
    pushMatrix();
    translate(width*0.25, height*0.87);
    rotate(-PI/10);
    polygon(0, 0, 19, 5, color(255));
    popMatrix();
    
    //Medical
    pushMatrix();
    noStroke();
    translate(width*0.75, height*0.855);
    polygon(0, 0, 47, 4, color(46, 184, 184));
    popMatrix();
    //inner diamond
    pushMatrix();
    stroke(255);
    translate(width*0.75, height*0.855);
    polygon(0, 0, 42, 4, color(0, 204, 255));
    popMatrix();
    //center diamond
    pushMatrix();
    stroke(255);
    translate(width*0.75, height*0.855);
    polygon(0, 0, 20, 4, color(46, 184, 184));
    popMatrix();
}

void maintCoach(float x, float y, float radius, color back, color mid, color fore) {
    stroke(back);
    fill(back);
    ellipse(x,y,radius,radius);
    fill(mid);
    arc(x,y, 0.98*radius, 0.98*radius, -PI/6+0.05, PI/6-0.05);
    arc(x,y, 0.98*radius, 0.98*radius, PI/6+0.05, PI/2-0.05);
    arc(x,y, 0.98*radius, 0.98*radius, PI/2+0.05, 5*PI/6-0.05);
    arc(x,y, 0.98*radius, 0.98*radius, 5*PI/6+0.05, 7*PI/6-0.05);
    arc(x,y, 0.98*radius, 0.98*radius, 7*PI/6+0.05, 3*PI/2-0.05);
    arc(x,y, 0.98*radius, 0.98*radius, 3*PI/2+0.05, 11*PI/6-0.05);
    fill(fore);
    ellipse(x,y, 0.5625*radius, 0.5625*radius);
}

void polygon(float x, float y, float radius, int npoints, color shape) {
  fill(shape);
  float angle = TWO_PI / npoints;
  beginShape();
  for (float a = 0; a < TWO_PI; a += angle) {
    float sx = x + cos(a) * radius;
    float sy = y + sin(a) * radius;
    vertex(sx, sy);
  }
  endShape(CLOSE);
}