xxxxxxxxxx
41
let starX;
let starY;
let starSize;
function setup() {
createCanvas(400, 400);
background(0);
fill(255);
noStroke();
}
function draw() {
background(0); // creates sparkle effecxt
let now = frameCount % 20
if (now == 0) {
drawStars();
} else {
}
}
function drawStars() {
starX = random(0,width);
starY = random(0,height);
starSize = random(2, 3);
starXa = random(0,width);
starYa = random(0,height);
starSizea = random(1, 3);
starXb = random(0,width);
starYb = random(0,height);
starSizeb = random(3, 4);
ellipse(starX, starY, starSize);
ellipse(starXa, starYa, starSizea);
ellipse(starXb, starYb, starSizeb);
}