1.3 vierkanten en cirkels

Ik heb vandaag 1.3 gemaakt. Ik ga nu meteen door met 1.4.

var u = 20;

function setup() {
createCanvas(400, 400);
}

function draw() {

grid();
displayMousePosition();
stroke(1);
strokeWeight(1);
rect(0, 0, 60);
rect(0, 340, 60);
rect(340, 340, 60);
rect(340, 0, 60);
circle(30, 30, 60);
circle(370, 30, 60);
circle(370, 370, 60);
circle(30, 370, 60);

}

function grid() {
background(200);
stroke(220);
strokeWeight(1);
for (let x = 0; x <= width; x += u) {
for (let y= 0; y <= height; y += u) {
line(x, 0, x, height);
line(0, y, width, y);
}
}
stroke(‘black’);
}

function displayMousePosition() {
textFont(‘menlo’);
textSize(18);
noStroke();
text(“x:” + mouseX, 190, 190);
text(“y:” + mouseY, 190, 210);
}