xxxxxxxxxx
27
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
let startAngle = 0;
let angleVel = 0.05;
function setup() {
createCanvas(640, 360);
colorMode(RGB, 255, 255, 255, 100);
}
function draw() {
background(51);
startAngle += 0.015;
let angle = startAngle;
for (let x = 0; x <= width; x += 24) {
let y = map(sin(angle),-1,1,0,height);
noStroke();
fill(255,100);
ellipse(x,y,16,16);
angle += angleVel;
}
}