Date: June 30, 2025
Challenge: Exploding Sun – Animate with draw() and variables
What I Worked On:
I built on my previous sun animation by adding two clouds that cover the sun at first. I adjusted the cloud positions to block the sun initially, then animated them to move away from the center while the sun grows larger. All of this was done inside the draw() loop using variables.
What I Learned:
What Went Wrong / What I Fixed:
At first, the clouds didn’t cover the sun properly because I didn’t adjust leftX and rightX carefully. Once I moved their starting positions closer to the center, they covered it like I wanted. I also forgot to update the sunRadius at first, so it wasn’t growing — that was a quick fix by adding sunRadius += 2.
Next Steps / Improvements:
Eventually I want to add an effect where the sun stops growing after a certain point or resets. I’m also interested in moving the sun across the sky like a sunrise-to-sunset animation.