Learning Thursday: It's Raining Tutorial
It’s #LearningThursday, and we’re back with another Scratch tutorial! As you might have figured out from our other posts, it’s been a little gloomy this week in San Diego. But don’t despair, we’re taking full advantage of the weather and channeling our rainy day frustrations into fun times for Sprite the cat! Today, we’re going to make it rain in Sprite’s world - Scratch style! You can see what your projects should end up looking like here. This week’s tutorial is a little bit longer than last week, and we’re going to make them a bit more challenging week by week. But as always, if you have questions, comments, or want to share your finished product with us, reach out on social media or via email at firstname.lastname@example.org! Let’s get this show on the road:
Paint a blue rain drop sprite and position it using x and y coordinates so that it’s in top center of the screen.
With the rain drop sprite selected, go to the Events category and get a green flag block to start your code.
From the Motion category, get a “go to” block. When you put it in your code, it’ll automatically fill in the numbers for the x and y coordinates where your raindrop is currently located!
Now go to the Control category and get a “repeat until” block. After you have that, go to the Operators category and get a “less than” block and type in -170. From the Motion category, get a “change y by” block and type in -10. The combination of these blocks is going to tell the raindrop where to move and how far.
So we’ve told our raindrop how to move - now how long do we want it to rain for? Well, it’s been so rainy in San Diego, we don’t think it’s ever going to end. To copy that in this project, let’s make it rain forever! We’ll do that by putting the other motion and control blocks in a “forever” loop block, from the Control category.
Let’s see if our rain drop moves the way we want it to! Test the code by clicking on the green flag button in the top of the console window, and seeing if it does what you expected.
Alright, so hopefully the rain drop behaved like rain when you tested it! Now, everyone knows it never rains with just one drop - so let’s make some more. More more rain drop sprites by right clicking on the original one and clicking “duplicate.”
Since we don’t want all the rain in one spot, change the x coordinate number on the “Go to” block so that you have rain drops all over the screen!
You’re done! Click the green flag button again and make sure it’s raining the way you want it to :) As the #WeCanChallenge for today, see if you can make the raindrops fall at different times. (Hint, it’ll involve using the “wait __ secs” block, pictured below). If you’re stuck and need help, you can see Dr. Guthals’ project here.
Hope you all had fun, until next week!