xxxxxxxxxx
20
function setup() {
createCanvas(windowWidth, windowHeight);
}
let yPeriodSec = 2;
function draw() {
background(255, 180, 255);
let x = width / 2;
let yAmplitude = height;
let yOffset = 0;
let yPeriod = yPeriodSec * getTargetFrameRate();
let y = yAmplitude * (sin((TWO_PI / yPeriod) * frameCount) + 1) * 0.5;
ellipse(x, y + yOffset, 25);
}