Project 5

sketch


// Michelle Dang
// Section D
//mtdang@andrew.cmu.edu
//Assignment-05-A
var s = 30;

function setup() {
    createCanvas(600, 600);
    background(231, 194, 105);
}
function draw() {
    //shape 1 loop
        for (var y = 100; y<600; y+=100) {
            for (var x = 100; x< 600; x+=100) {
                shape1(x, y);
            }
        }
//shape 2 loop
      for (var y = 50; y<600; y+=100) {
            for (var x = 50; x< 600; x+=100) {
                shape2(x,y);
            }
        }
}
//shape with blue rectangle 
function shape1(x, y) {
    fill(245, 161, 97);
    ellipse(x, y,  s+50, s);
    ellipse(x, y, s, s+50);

    fill(232, 109, 78)
    ellipse(x, y, 50, 50)
    ellipse(x, y, 50, s);
    ellipse(x, y, s, 50);

    fill(150, 150, 86);
    ellipse(x, y, 10, 10);
}
//shape with salmon-colored middle
function shape2(x,y) {
    fill(39, 68, 86);
    rect(x-25, y-25, 50, 50);   

    fill(150, 100, 150);
    ellipse(x, y,  s+50, s);
    ellipse(x, y, s, s+50);

    noFill();
    ellipse(x, y, s, s);
    ellipse(x, y, s, 50);

    fill(100, 100, 255);
    ellipse(x, y, 10, 10);

}
noLoop();

I took inspiration from kaleidoscopes.

Leave a Reply