xxxxxxxxxx
64
function setup() {
createCanvas(500, 500);
rectMode(CENTER);
}
function draw() {
background(255);
for(let i=0; i<5; i++){
for (let j=0; j < 5; j+=2)
makeTile(i*100+50, j*100+50);
}
}
function makeTile(x,y) {
stroke(0);
noFill();
strokeWeight(2);
rect(x, y, 100, 100);
fill(102, 186, 255);
strokeWeight(1);
triangle(x+10, y-45, x+45, y-45, x+45, y-10);
fill(102, 186, 255);
strokeWeight(1);
triangle(x-10, y+45, x-45, y+45, x-45, y+10);
fill(102, 186, 255);
strokeWeight(1);
triangle(x-10, y-45, x-45, y-45, x-45, y-10);
fill(102, 186, 255);
strokeWeight(1);
triangle(x+45, y+10, x+45, y+45, x+10, y+45);
fill('gold');
strokeWeight(1);
triangle(x, y, x+15, y-15, x-15, y-15);
fill('gold');
strokeWeight(1);
triangle(x, y, x+15, y+15, x-15, y+15);
line(x+15, y-15, x+15, y+15);
line(x-15, y-15, x-15, y+15);
push();
noFill();
stroke(204, 51, 0);
strokeWeight(5);
translate(x, y);
rotate(PI / 4 * sin(frameCount * 0.025));
rect(0, 0, sqrt(4512.5), sqrt(4512.5));
pop();
}