xxxxxxxxxx
21
let a = 0;
let amplitude = 20;
let yoff = 0;
function setup() {
createCanvas(800, 800);
background(20);
angleMode(DEGREES);
}
function draw() {
let yADJ = map(mouseY, 0, height, -500, 500)
yoff = (yoff + yADJ)%height;
a = (a+10)%width;
push();
translate(a,amplitude*sin(a)+yoff);
ellipse(0,0,cos(a+frameCount)*50);
pop();
}