xxxxxxxxxx
float x = 250;
float t = 0;
void setup() {
size(500, 800);
noStroke();
}
void draw() {
fill(#24093f, 40);
rect(0, 0, width, height);
t += 0.04;
float offset = map( sin(t), -1, 1, -100, 100);
fill(255);
// replace height/2 with mouseX or mouseY to make it move with the mouse
ellipse(x + offset, height/2, 30, 30);
}