arrow_back Follower Friend
In this add-on, you’ll make a fun little friend who follows the hero around on its adventure.
This add-on uses a block you may not have used before, but you’ll see quickly what it does.
Then, you’ll figure out the rest for yourself!
Remember, you’re a computer scientist, and computer scientists persevere and use their minds to find solutions!
First, pick your follower friend, or draw your own.
You may need to use the shrink tool to make it travel-size.
The block you need is in the sensing menu.
It’s a round one near the bottom.
The first dropdown lets you pick different attributes, which, if you notice, are all the names of the round blocks in other menus.
The second dropdown lets you pick a sprite.
So, with this block you can get, say, the x position of the hero, even in the code for your new follower sprite.
You’ll use two of these blocks for this add-on, one for the x position and one for the y position.
The other things you’ll use are a “forever” loop, a “glide” block, and some “plus” or “minus” blocks if you want to change exactly how far ahead or behind the follower follows.
Your final code might look like a really long “glide” block.
For a bigger challenge, think about how to make the follower move around randomly a little bit, even when the hero is standing still.
Or, figure out how to animate the follower with different movements or costumes.
Have a blast!
Now, it’s your turn.
Make a new follower sprite.
Use the round “sensing” block, " forever", “glide,” and "addition," and "subtraction" blocks.
Challenge yourself by adding random motion and animation!