xxxxxxxxxx
52
let snowflakes = [];
function setup() {
createCanvas(400, 400);
noStroke();
fill(255, 165, 0);
}
function draw() {
background(135, 206, 250);
// Create a new snowflake at random x position
let snowflake = {
x: random(width),
y: 0,
size: random(5, 15),
speed: random(1, 3)
};
snowflakes.push(snowflake);
// Iterate through the snowflakes and update their positions
for (let i = snowflakes.length - 1; i >= 0; i--) {
let flake = snowflakes[i];
flake.y += flake.speed;
// Draw the snowflake
ellipse(flake.x, flake.y, flake.size);
// Remove snowflake if it goes off-screen
if (flake.y > height) {
snowflakes.splice(i, 1);
}
}
noStroke()
fill("# white")
ellipse(200,370,190,240)
circle(200,200,140)
fill("black")
circle(200, 340, 20)
circle(200, 300, 20)
circle(200, 380, 20)
stroke(0)
strokeWeight(3)
}