xxxxxxxxxx
26
let count = 0; // initialize a counter variable
function setup() {
createCanvas(400, 300);
rectMode(CENTER);
}
function draw() {
background(1, 186, 240);
// declaration of variables
let x = width / 2;
let y = height / 2;
let size = 200 + count; // control the size of the shapes
// circle
fill(237, 34, 93);
noStroke();
ellipse(x, y, size, size);
// rectangle
fill(255);
rect(x, y, size*0.75, size*0.15);
count = count + 1; // increment the counter variable
}