xxxxxxxxxx
32
let xSpacing = 15;
let ySpacing =3;
let xMargin = 50;
let yMargin = 100;
let maxJ = 1; // the maximum vertical jitter
let maxW = 10; // the maxium possible circle width
function setup() {
createCanvas(800, 400, SVG);
noFill();
noLoop(); // tells the draw function NOT to repeat
}
function draw() {
background(220);
for (let y = yMargin; y < height-yMargin; y += ySpacing) {
let w = random(maxW);
let index = 0;
for (let x = xMargin; x < width-xMargin; x += xSpacing) {
let jit = random(-maxJ*index,maxJ*index);
circle(x, y+jit, w);
index++;
}
}
}