Learning Thursday: Follow Me Tutorial
Afternoon, everybody! Hope your weeks are going wonderfully - don’t forget to check out Dr. Guthals’ interview with Dan Lenzen, going live today at 5 PM on the YouTube Channel! This tutorial, combined with that video, kick off the first #LearningThursday here at the We Can Zone! Every Thursday, we’ll be doing some kind of tutorial in Scratch for y’all to build a cool new project. Once a month, we'll also post an interview video with someone we find inspiring (like Dan today!). This week, we’re going to get Sprite the cat to follow our mouse wherever it goes! We’ve got it laid it out for you in simple steps below, and you can see a video of what it’s supposed to look like here. As always, if you have questions, comments, or want to share your finished project with us, reach out on social media or via email at firstname.lastname@example.org! Without further ado, let’s get started:
To start any code in Scratch, we want to use the green flag block, which you can see in the picture below. This will start your code as you have it listed whenever you click on the green flag button in the Scratch editor. Get to the block from the Events category!
Now that we have the starter block, we want to tell Sprite the cat what to do. We defined our goal above: every time we move our mouse, we want Sprite to follow. So, to begin with, we want to make sure Sprite does that, using the “point towards” block (from the Motion category), and define it as towards the “mouse-pointer.”
Next, we have to make sure Sprite actually moves in the direction we set! To do that, we’re going to define how far Sprite moves, using another block from the Motion category: “move ___ steps.” You can see it in the same picture from the last step! For the purposes of this tutorial, we’re going to define Sprite’s movement as 10 steps in the direction of the mouse-pointer (hint: for the challenge at the end of the tutorial, this is the part you want to focus on!).
So now, we’ve set the rules for how Sprite will move. But how long do we want Sprite to do it for? We think we’re pretty cool, and we’d like our friend Sprite to follow us around wherever we want, forever. To make that happen, we’re going to use a forever loop! Find this block in the Control category, and drag it into your program so that it goes around the point and move blocks, after the green flag block.
Ta-da, you’re all done! Time to play with your project. Move your mouse and watch your new friend Sprite the cat follow you wherever you go :) If you want an added challenge, try to make Sprite move faster, or slower (remember the hint we gave you before?). If you’re stuck and need help, you can see Dr. Guthals’ project here.
Till next week everyone, hope you have fun with this tutorial! If you have ideas for projects you'd like to see in future posts, reach out and let us know!