xxxxxxxxxx
50
var tileCount = 20;
var actRandomSeed = 0;
function setup() {
createCanvas(700, 700);
strokeCap(ROUND);
}
function draw() {
clear();
background(255,255,251);
randomSeed(actRandomSeed);
for (var gridY = 0; gridY < tileCount; gridY++) {
for (var gridX = 0; gridX < tileCount; gridX++) {
var posX = width / tileCount * gridX;
var posY = height / tileCount * gridY;
var toggle = int(random(0, 2));
if (toggle == 0) {
stroke(116,143,135, 50);
strokeWeight(20);
line(posX, posY, posX + 40, posY + 40);
stroke(205,197,138,50);
strokeWeight(20);
line(posY, posX, posY + 12, posX + 12);
stroke(205,197,138);
strokeWeight(1);
line(posX, posY, posX + width / tileCount, posY + height / tileCount);
}
if (toggle == 1) {
stroke(205,197,138);
line(posX, posY + width / tileCount, posX + height / tileCount, posY);
noStroke();
fill(205,122,35);
ellipse(posX, posY + width / tileCount, 10, 10);
}
}
}
}
function mousePressed() {
actRandomSeed = random(100000);
}