Date: June 29, 2025

Challenge: Exploding Sun – Variable Growth with draw()


What I Worked On:

Today I animated a sun by creating a draw() function and using a variable called sunSize to make the sun grow over time. I started with a static scene (sun + land), then wrapped it inside draw() so it could update continuously. I increased the sun’s size by adding 1 to the sunSize variable on each frame.


What I Learned:


What Went Wrong / What I Fixed:

At first, I placed the background color inside setup() and couldn’t understand why the sun left a trail. Once I realized the canvas needs to be cleared each frame, I moved background() into draw(). I also forgot to initialize sunSize at the top, but fixing that made the sun grow correctly.


Next Steps / Improvements:

I want to add a limit to how big the sun gets or maybe make it reset after reaching a certain size. Eventually, I’d like to animate a sunset or include clouds that move.