xxxxxxxxxx
56
// Things to teach!!!
// fill, stroke
// comments
// for loops, if statements, arrays
// circle, rect, line
// mouseClicked
// frameCount
// noise
// incrementing, map
let cRad = 20;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
// fill('red');
// circle(200, 200, 200);
// circle(width/2, height/2, 200);
// circle(100, 200, 30);
// circle(150, 200, 30);
// circle(200, 200, 30);
// circle(250, 200, 30);
// circle(300, 200, 30);
// const cRad = 30;
// circle(100, 200, cRad);
// circle(150, 200, cRad);
// circle(200, 200, cRad);
// circle(250, 200, cRad);
// circle(300, 200, cRad);
fill('red');
const colors = [
'red', 'yellow', 'blue', 'green', 'purple'
];
for(let i = 0; i < 5; i++) {
let y = 200;
if (i % 2 === 0) {
y = 210;
}
fill(colors[i]);
circle(i * 50 + 100, y, cRad);
}
}
function mouseClicked() {
cRad+= 10;
}