xxxxxxxxxx
29
function setup() {
createCanvas(400, 400);
}
function draw() {
//background(220);
}
function keyPressed(){
if (key == ' '){
// noLoop();
setTimeout(drawGrowingCircle,1000);
}
}
function drawGrowingCircle(){
var currentFrameCount = frameCount;
var targetFrameCount = currentFrameCount + 250;
var i = 0;
console.log(currentFrameCount);
console.log(targetFrameCount);
noStroke();
fill(0, 0, random(100, 255));
while (frameCount < targetFrameCount){
ellipse(width/2, height/2, i, i);
i++;
}
}