xxxxxxxxxx
27
// declare / assign my global variables
// 3 keywords for declaring a variable:
// const, var, let
// we will use 'let'
let yOffset = 200;
function setup() {
createCanvas(600, 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(204);
// i = i + 60 is the SAME as i += 60
for(let i = 20;i < 381;i=i+20){
strokeWeight(i);
stroke(i);
line(i, yOffset, i+60, yOffset+40);
}
}