xxxxxxxxxx
87
let snowflakes = [];
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(135, 206, 255);
// Create a new snowflake at random x position
let snowflake = {
x: random(width),
y: 0,
size: random(5, 18),
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
fill(255, 235, 0);
noStroke()
ellipse(flake.x, flake.y, flake.size);
// Remove snowflake if it goes off-screen
if (flake.y > height) {
snowflakes.splice(i, 1);
}
}
noStroke()
fill(0)
triangle(260,340,270,350,340,250)
fill(190,110,240)
triangle(340,250,330,200,350,200)
fill(200,20,20)
circle(340,190,20)
circle(350,185,18)
circle(355,180,15)
circle(357,175,13)
circle(358,170,11)
circle(359,165,9)
circle(360,161,6)
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)
fill(200,100,100)
noStroke()
circle(170, 180,20)
circle (230,180,20)
fill(255, 165, 0)
triangle(170,230,210,220,200,204)
}