xxxxxxxxxx
24
// declare / assign my global variables
// 3 keywords for declaring a variable:
// const, var, let
// we will use 'let'
let xOffset = 20;
let yOffset = 10;
let yDelta = 0.1; // delta is a greek letter that means CHANGE!
let spacing = 2; // distance between circles' centers
let w = 4; // width of circles
function setup() {
createCanvas(400, 400);
//console.log(count); // before we used console.log to check mouseX and Y
noLoop(); // amke it so the draw loop function runs only once.
}
function draw() {
background(220);
// i is an index of our repetions
for (let i = 0;i < 100; i = i +1) {
circle(xOffset+spacing*i,yOffset+yDelta*i,w);
}
}