xxxxxxxxxx
32
let x = 0;
let y;
function setup() {
createCanvas(400, 400);
y = height;
}
function draw() {
background(20);
let b = map(x, 0, width, 0, 255);
fill(x, x, x);
ellipse(x, y, 50);
x = (x+1) % (height/(x%3 ));
y -= 1;
}
function backAndForth(current) {
if (x>=397)
{
x/=1.01;
return x;
}
else
{
x*=1.01;
return x;
}
}