xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight)
background("white")
noLoop()
angleMode(RADIANS)
}
function draw() {
drawTileGrid();
//drawOneTile();
}
function drawTileGrid() {
for (let x = 0; x < windowWidth + 100; x += 100) {
for (let y = 0; y < windowHeight + 100; y += 100) {
noStroke();
if (random() > 0.1) {
continue;
}
drawTileB(x, y)
}
}
}
function drawTileB(x, y) {
push();
translate(x, y);
rotate(random([0, PI, PI/2, PI*2]));
fill("#27AE60");
rectMode(CENTER)
rect(0, 0, 100, 100)
strokeWeight(5)
stroke("#8E44AD ");
arc(0, 50, 100, 100, PI, 0)
noStroke();
fill("#EC7063 ");
beginShape();
vertex(50, -50);
vertex(0, 25);
vertex(0, -25);
vertex(-50, 50);
endShape();
pop()
}