Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a question from Khan Academy. I'm not sure how to go about doing some of these requirements. I know how to make a
This is a question from Khan Academy. I'm not sure how to go about doing some of these requirements. I know how to make a new drop when the user clicks, but other than that I'm lost. Please help!
1 var Positions [200] 2 var y Positions [0 4 draw function background (204, 247 255); 7 for (var i 0; i xPositions. length it nostroke(); fill (0, 200, 255) ellipse (xPositionsli yPositionsli 10, 10) 10 yPositionsli 5; 11 12 13 14 h; Start over Request Help Restart Save About Documentation Guidelines To make an animation of rain, it's best if we use arrays to keep track of the drops and their different properties. Start with this simple code and build on it to make a cool rain animation. Here are some ideas for what you could do: Add more drops to the arrays. Make it so that the drops start back at the top once they've reached the bottom, using a conditional Make an array of colors, so that every drop is a different color. Make other things rain, like snowflakes (using more shape commands) or avatars (using the image commands). Make it so that when the user clicks, a new drop is added to the array Initialize the arrays using a for loop and random function, at the beginning of the programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started