xxxxxxxxxx
25
let starX = []; // array to save X coordinates
let starY = []; // array to save Y coordinates
let starO = []; // array to save opacity values
function setup() {
createCanvas(windowWidth, windowHeight);
// frameRate(24);
for (let i = 0; i < 200; i++) {
starX[i] = random(0, windowWidth); // setting random values
starY[i] = random(0, windowHeight);
starO[i] = random(0, 255);
}
console.log(starO);
}
function draw() {
background(0,0,0);
for(let i = 0; i < 600; i++) { // loop to display all of the circles
fill(255, 255, 255, starO[i])
ellipse(starX[i], starY[i], 5, 5);
}
}