Hello everyone! Today, we’re going to learn how to make a fun mouse trail in Scratch. This means that when you move your mouse around, little pictures will follow it, creating a cool effect. Let’s dive in and see how we can do this!
First, we need to pick what kind of pictures, or “sprites,” you want to follow your mouse. You can choose anything you like! It could be Scratch cats, hearts, stars, balloons, or even a cute squirrel. To pick a sprite, hover over “Choose a Sprite” and click “Choose.”
Once you’ve chosen your sprite, let’s make it follow your mouse. In the “Motion” category, find the block that says “go to random position.” Click on the menu and select “mouse pointer.” Now, whenever you click this block, your sprite will go to your mouse pointer. If you put this block inside a “forever” loop, the sprite will always follow your mouse around the screen.
Now, let’s make a trail of sprites. In Scratch, you can make copies of a sprite using the “create clone of myself” block in the “Control” category. When you click this block, it makes a copy of your sprite. If you put this block inside the “forever” loop, your sprite will leave a trail as it follows your mouse.
We can make the clones do fun things with code! Use the “when I start as a clone” block to add actions for the clones. For example, you can make them change color by using the “change color effect by 25” block. You can also add a “repeat” loop to change the color multiple times.
After the clones change color, you can make them disappear by adding the “delete this clone” block. This way, the trail will always follow your mouse without getting too crowded.
Try adding different blocks inside the repeat loop to see what happens. For example, use the “change X by 10” block to make the clones move sideways, or “change Y by 10” to move them up. You can also use “change Y by -10” to move them down.
One cool effect is to make the sprites spread out in all directions. Use the “point in direction” block with a “pick random” block set from 0 to 360 degrees. This makes the sprite move in a random direction when you click “move 10 steps.”
If you want to change the look of your mouse trail, click on the “Costumes” tab and pick a new costume. You can also use the “change size by” block with a negative number to make the sprites get smaller as they move.
Another fun effect is the “change ghost effect” block, which makes the sprite more see-through. If you set it to change by a small amount, like 5, the sprites will slowly fade away as they move.
Feel free to try other blocks, like the “turn” block, to see how it changes the clones. Experiment with different blocks in the repeat loop and discover what you enjoy the most!
That’s all for today! I can’t wait to see all the amazing mouse trails you’ll create. Have fun experimenting, and remember to keep scratching on!
Mouse Trail Art Gallery: Create your own mouse trail art! Open Scratch and design a unique sprite using the “Costumes” tab. Experiment with different shapes and colors. Once you’ve created your sprite, use the “create clone of myself” block to make a trail. Try different effects, like changing colors or sizes, and see how your art changes. Share your favorite designs with your classmates and explain what you did to make them special.
Trail Detective: Go on a detective mission to find mouse trails in everyday life. Look for patterns or trails in nature, like the path ants take or the way leaves fall from a tree. Draw a picture of what you observe and think about how it is similar to the mouse trail you created in Scratch. Discuss with your family or friends how these trails are formed and what makes them interesting.
Trail Experimentation: Use Scratch to test how different blocks affect your mouse trail. Try using the “change ghost effect” block to make your sprites fade away slowly. What happens if you change the number in the block? Experiment with the “point in direction” block to see how it changes the movement of your sprites. Write down your observations and share them with your class. Which effect did you like the most and why?
Sure! Here’s a sanitized version of the YouTube transcript:
—
Hi everyone! It’s Zoë from the Scratch Team, also known as Zinnea. Today, I wanted to show you how to make a mouse trail in Scratch. You can choose any items you want to be in the mouse trail, and I’ll demonstrate various effects. Let’s get started!
First, let’s pick the object you want to use for your mouse trail. You can hover over “Choose a Sprite” and click “Choose.” You could have a mouse trail of Scratch cats, hearts, stars, balloons, rainbows, or even the squirrel sprite—really anything you want!
The first example I’ll show is a trail of Scratch cats. To make a sprite follow your mouse pointer, there’s a block in the motion category that says “go to random position.” If you click on the menu and choose “mouse pointer,” then whenever you click on this block, it makes the sprite go to your mouse pointer. If you put that block inside a forever loop, the sprite will always follow your mouse wherever you move it on the screen.
Now, how do we create a trail with multiple Scratch cats following the mouse pointer? In Scratch, you can create duplicates of a sprite using the block in the control category called “create clone of myself.” Clicking this creates a duplicate of the Scratch cat. So, as you move around, if you click “create clone of myself,” it makes another Scratch cat.
These clones can also perform actions with code. To do that, use the block “when I start as a clone.” If you drag this block out and add some code underneath it, the clones will execute that code when they are created. For example, we can make them change color by using the “change color effect by 25” block. We could even add a repeat loop to change color multiple times.
After the color change, we can make the clones disappear by adding the “delete this clone” block. This way, the trail will always follow your mouse without lingering too far behind.
To create clones constantly while dragging your mouse, place the “create clone of myself” block inside the forever loop. Now, as you drag the cat around, it creates clones, leaving a trail of rainbow cats wherever it goes.
One important note: it’s usually not advisable to have a “create clone of myself” block inside a forever loop because creating too many clones can slow down the computer. However, in this case, since the clones are deleted after a short animation, it works fine.
This basic code will create a mouse trail. You can experiment by adding different blocks inside the repeat loop to see what effects you get. For instance, you could add a “change X by 10” block, which would make the clones move horizontally. Similarly, adding “change Y by 10” would move them upward, and using “change Y by -10” would create a downward effect.
One of my favorite effects is to make the items in the mouse trail spread out in every direction. You can achieve this by using the “point in direction” block along with a “pick random” block set from 0 to 360 degrees. This way, when you click the “move 10 steps” block, the sprite will move forward in a random direction.
If you want to switch the object in your mouse trail, you can click on the costumes tab and select a new costume. You could also try using a “change size by” block with a negative number to make the items smaller as they move out.
Another fun effect is to use the “change ghost effect” block, which makes the sprite more transparent. If you set it to change by a small amount, like 5, the objects will gradually fade as they move outward.
Feel free to experiment with other blocks, like adding a “turn” block to see how it affects the clones. I encourage you to try different blocks in the repeat loop and see what you like!
That’s what I wanted to share with you today. I’m excited to see all the mouse trails that people will create! If you want to use the code from this starter project, it will be in the description below. Have fun making mouse trails, and I’ll see you next time. Scratch on!
—
This version removes any informal language and maintains a clear instructional tone.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |