serinal- project 5 (section C)

sketch

function setup() {
    createCanvas(640, 480);
    background(224, 255, 255);

 	var constant = (sqrt(3)/2)*20; // value for the width
    var row = 8;
    var w = 65; //spacing
    var th = constant;
    var oy = 10; // original y
    var ox = 2; // original x

    for (var y = 0; y < 8; y++) {
        for (var x = 0; x < row; x++) {
            var py = oy + y * th;
            var px = ox + x * w;
            if (y%2 == 0){
            	noStroke();
            	fill (112, 128, 144);
            	rect(px+w*0.3, py*8, 10, 10); //smaller rectangles (top n bottom)
            	row = 10; 
            } else {
            	noStroke();
            	fill (176, 192, 222);
            	rect(px, py+119, 50, 50); //larger rectangle in middle
            	row = 10;
            }
        }
    }
    noLoop();
}

function draw(){
	for (var i =0; i<800+40; i+=30) {
		stroke (30, 144, 225);
		strokeWeight (2);
    	line(i-2, 35, i+5, 40); //shorter line top
    	line (i-2, 35, i+5, 50); //longer line bottom
    	stroke (245, 255, 250, 80);
    	line (2, 3*i, 5*i, 1);
    	stroke (30, 144, 225);
    	strokeWeight (2);
    	translate (-5, 0);
    	line (i+40, 400, i+25, 405);
    	line (i+40, 400, i+25, 420);
    }
}

This project was pretty low-key for me and I wanted to keep my project mostly geometric/basic. I liked playing around with the colors and I chose to do a blue-guided color palette. If I had more time, I definitely would want to make it a little more complex.

Leave a Reply