function draw(p8g, {frame}){
const { background, noStroke, stroke, fill, ellipse, noSmooth} = p8g;
const {sin, cos, random} = Math;
let frameCount = frame()
if(clearBG%2) background(0)
if(window.setup == 0) {
background(0)
window.setup++
}
fill(flip%2?0:255)
noSmooth()
noStroke()
for (let i = 0; i < points.length; i++) {
let size = map( noise(points[i].x * 0.001, points[i].y * 0.001, frameCount*0.001), 0, 1, -grid, grid );
points[i].x += sin(size)
points[i].y += cos(size)
if (points[i].x > Width) points[i].x = random(Width)*Width;
if (points[i].x < 0) points[i].x = random(Width)*Width;
if (points[i].y < 0) points[i].y = random(Height)*Height;
if (points[i].y > Height) points[i].y = random(Height)*Height;
ellipse(points[i].x, points[i].y, size, size);
}
}