xxxxxxxxxx
22
let d = 10; // declaring and instantiating a variable
d = d + 10;
console.log(d);
function setup() {
createCanvas(600, 400);
frameRate(24) // slowing down the frame rate so we can see the animation a little better
}
function draw() {
console.log("current frame: " + frameCount); // frameCount is a P5JS variable that shows the number of frames that have elapsed since the canvas loaded
background(245, 245, 255);
fill(0,0,255);
stroke(0,0,255);
fill(255)
circle(200, 200, d); // using the w variable for the width of our circle
d = d + 1; // adding one to the d value every time the draw function loops
console.log("diameter is: " + d)
}