Project Wallpaper

wallpaperDownload
var x = 0
var y = 0
var side = 50

function setup() {
    createCanvas(400, 400);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function coolShape(x, y) {
	strokeWeight(3);
	stroke(95, 57, 1);
	fill(250, 195, 14);
	//left quad
	quad(x, y, (x + 2*(side/3)), (y + (-side/2)), (x + 2*(side/3)), (y + (side/2)), x, (y + side))
	//right quad
	quad((x + 2*(side/3)), (y + (-side/2)), (x + 4*(side/3)), y, (x + 4*(side/3)), (y + side), (x + 2*(side/3)), (y + (side/2)));
	//bottom quad
	quad(x, (y + side), (x + 2*(side/3)), (y + (side/2)), (x + 4*(side/3)), (y + side), (x + 2*(side/3)), (y + 2*side));
}

function draw() {
	background(250, 195, 14);
	for (var r = 0; r <= 400; r += (dist(x, (y + side), (x + 4*(side/3)), (y + side)))) {
		for (var i = 0; i <= 500; i += 4*(side/3)) {
			coolShape(r, i);
		}
	}
}

Leave a Reply