xxxxxxxxxx
41
/* refactor old code project to use createVector instead
of traditional x,y variables */
let size;
let pos;
function setup() {
createCanvas(600, 300);
rectMode(CENTER);
size = 200;
}
function draw() {
background(1, 186, 240);
// declaration of letiables
// let x = width / 2;
// let y = height / 2;
pos = createVector(width/2, height/2);
let size = 200;
if (frameCount < 30){
size = size + frameCount;
} else {
size = size + 30;
}
// ellipse
fill(237, 34, 93);
noStroke();
ellipse(pos.x, pos.y, size, size);
// rectangle
fill(255);
rect(pos.x, pos.y, size*0.75, size*0.15);
}