xxxxxxxxxx
30
//TAKEN FROM https://editor.p5js.org/aferriss/sketches/rJEftjpKG
// two empty arrays
var xPositions = [];
var yPositions = [];
var index = 0;
function setup() {
createCanvas(800,800);
// push a bunch of random positions into the arrays
for (var i = 0; i < 100; i++) {
xPositions.push( random(800) );
yPositions.push( random(800) );
}
frameRate(5);
}
function draw() {
background(220);
noFill(0);
strokeWeight(5);
// loop through the arrays and draw ellipses at the x and y positions
for(var i = 0; i < xPositions.length; i++){
curve(xPositions[i], yPositions[i], xPositions[i], yPositions[i], xPositions[i], yPositions[i], random(800), random(800));
}
}