xxxxxxxxxx
22
function setup() {
createCanvas(400, 100);
noStroke();
background(0);
}
function draw() {
// Fade away by clearing canvas with mostly transparent black.
background(0, 5);
// Uniform random number in the range of 0 to 400.
let randomX = random(0, 400);
fill(200, 50, 50); // red-ish
ellipse(randomX, 30, 16, 16);
// Normal random number clustering around 200 with the majority
// of generated values occuring in the 150 to 250 range.
let gaussianX = randomGaussian(200, 50);
fill(50, 50, 200); // blue-ish
ellipse(gaussianX, 70, 16, 16);
}