Project 05: Wallpaper

sketch
//amyhu
//amyhu@andrew.cmu.edu
//section d
//project 05

var s = 100

function setup() {
    createCanvas(600,600);
    background(220);
}

function draw() {
    //first column 
    for(let y = 0; y <= 600; y += 100){
        for(let x = 0; x <=600; x += 200){
            drawSquare(x,y);
        }
    }

    //offset column
    for(let y = -s/2; y <= 600; y += 100){
        for(let x = s; x <=600; x += 200){
            drawSquare(x,y);
        }
    }
}



function drawSquare(x,y){
    fill(50,10,40);
    noStroke();
    square(x,y,s);


    fill(130,2,99);
    arc(x+s,y,s,s,(radians(90)),-(radians(180)));
    fill(217,3,104);
    arc(x,y,s,s,0,(radians(90)));
    fill(234,222,218)
    arc(x,y+s,s,s,(radians(270)),(radians(0)));
    fill(46,41,78);
    arc(x+s,y+s,s,s,(radians(180)),(radians(270))); 
}

//offseted column
// function drawSquares(a,b){
//     fill(240);
//     square(x,y,s);
//     fill("red"); 
//     arc(x+s,y,s,s,(radians(90)),-(radians(180)));
//     arc(x,y,s,s,0,(radians(90)));
//     arc(x,y+s,s,s,(radians(270)),(radians(0)));
//     arc(x+s,y+s,s,s,(radians(180)),(radians(270))); 
// }

Leave a Reply