xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight)
background("white")
//noLoop()
angleMode(RADIANS)
frameRate(5)
}
function draw() {
randomSeed(6);
drawTileGrid(frameCount);
//drawOneTile();
}
function drawTileGrid(targetCount) {
let tileCount = 0;
for (let x = 0; x < windowWidth + 100; x += 100) {
for (let y = 0; y < windowHeight + 100; y += 100) {
noStroke();
tileCount++
if (tileCount >= targetCount) {
return
}
// 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);
arc(0, -50, 100, 100, 0, PI)
noStroke();
pop()
}