Date: June 30, 2025
Challenge: Shooting Star Animation
Folder: 12_shooting_star
For this challenge, I created a nighttime sky with two animated shooting stars. I decided to have one star move diagonally from the top-left to bottom-right, and a second star that travels from the bottom-right to top-left. I added a dark RGB background and layered in 50 small stars using ellipse() with randomized positions to give the illusion of a twinkling night sky.
Step 5 โ Starry Sky with Random Stars (Line 22):
ellipse(random(0, 400), random(0, 400), 1, 1);
This draws 50 tiny stars across the canvas. Because itโs placed inside a for loop inside draw(), each frame creates new randomized stars, which makes the sky shimmer. This creates a blinking effect rather than static stars.
/Step 6:Moving Star (Line 28-29):
x1 += 3;
y1 += 2;
These two lines gradually move the star across the canvas. By adding to x1 and y1 each frame, the star travels diagonally. For the second star, I reversed the directions using x2 -= 2 and y2 -= 3 to move it up and to the left.