xxxxxxxxxx
32
/*
*** BREATHING CIRCLE ***
Shapes and Define Your Own Variables with The Coding Train ˜ https://thecodingtrain.com/
Sketch made by Leonardo M. Louzas ( https://github.com/leonardomlouzas ) | 12/aug/24
*/
const maxSize = 100;
let speed = 1;
let circleSize = 10;
function setup() {
createCanvas(400, 300);
}
function draw() {
// Adjust circle size
circleSize += speed;
if (circleSize > maxSize || circleSize < -maxSize) {
speed *= -1;
}
background(0);
noStroke();
fill(255, 255);
circle(200, 150, circleSize);
}