xxxxxxxxxx
24
class BackgroundStar
{
constructor()
{
this.backStars = 10;
}
displayBgStar()
{
for (let i = 0; i < this.backStars; i++)
{
// Generating random x, y coordinates
let x = Math.random() * windowWidth;
let y = Math.random() * windowHeight;
fill(255);
noStroke();
// Drawing ellipses at random sizes
ellipse(x, y, random(0.0001, 3), random(0.0001, 3));
}
}
}