Hello everyone! Today, we’re going to learn about a cool feature in Scratch called video sensing. This feature lets you use your computer’s webcam to interact with your Scratch projects. It’s like magic, and I’m excited to show you how it works!
First, let’s find the video sensing blocks. You’ll find them in the “Sensing” category in Scratch. There are three special blocks for video sensing:
Let’s start with the “Turn video on” block. This block will activate your webcam. Drag it out and connect it to an event, like when the green flag is clicked. Now, when you click the green flag, your webcam will turn on, and you’ll see the video feed in the background.
You might notice a white haze over the webcam feed. This is the backdrop, and you can change how much of it you see with the “Set video transparency” block. If you set it to 0, you won’t see any backdrop. If you set it to 100, you’ll see the full backdrop. A good balance is 50 percent, so you can see both the backdrop and the webcam image.
Now, let’s talk about the “Video motion on this sprite” block. This block measures how much movement is happening in front of the webcam. It uses a scale from 0 (no motion) to 100 (a lot of motion). You can see how much motion is happening by turning on a reporter next to the block. If you move, you’ll see the numbers go up!
Let’s make a fun project to see video sensing in action. We’ll make a cat meow when it detects enough motion. Here’s how:
Try it out! When you move in front of the webcam, you’ll hear the cat meow. This is just one way to use video sensing blocks to create fun interactions in your Scratch projects.
I hope you enjoyed learning about video sensing in Scratch. Now it’s your turn to create something amazing with these blocks. Have fun experimenting and see what cool projects you can make!
Open Scratch and navigate to the “Sensing” category. Find the video sensing blocks: “Video motion on this sprite,” “Turn video on,” and “Set video transparency.” Experiment with each block to see how they work. Try turning the video on and adjusting the transparency to see the effects on your screen.
Use the “Video motion on this sprite” block to create a sprite that reacts to your movements. Set up a script that changes the sprite’s costume or color when you move in front of the webcam. Test it by moving around and watch your sprite come to life!
Create a simple game where you have to move to control a character. Use the video motion block to make the character jump or dodge obstacles based on your movements. Challenge yourself to complete the game using only your motion as input!
Play with the “Set video transparency” block to see how it affects your project. Try different transparency levels and observe how the video feed blends with your Scratch backdrop. Create a project where the transparency changes dynamically based on certain conditions, like time or score.
Once you’ve created a project using video sensing, prepare a short presentation to share with your classmates. Explain how you used the video sensing blocks and demonstrate your project. Be ready to answer questions and give tips on how others can use video sensing in their projects.
Here’s a sanitized version of the provided YouTube transcript:
—
Hello everyone, it’s [Name] from the Scratch team at MIT. Today, I want to show you how to use video sensing blocks. If you’re not familiar with video sensing, it allows someone to interact with your Scratch project using the webcam on their computer. It’s a really cool set of blocks, and I’m excited to show you how to use them today.
We will find the video sensing blocks in the sensing category. Let’s go ahead and click that. The three video sensing specific blocks are right here. One is a variable called “video motion on this sprite,” another block says “turn video on,” and finally, there’s “set video transparency.” We’ll dig into all three of these.
Let’s start with the middle one, “turn video on.” This block activates the webcam, enabling video sensing in your project. I’ll drag that out and make it an event, so when the green flag is clicked, the video will turn on.
Now that the webcam is on, you can see the image in the background, which is the feed from the webcam. This is important for creating interactions in our project. You might notice a white haze over the webcam feed; that’s the backdrop displayed on top of the webcam image. We can manipulate this with the “set video transparency” block. Right now, it’s set to 50 percent transparency. If we change it to 0 and click the green flag, we won’t see any backdrop. Conversely, if we set it to 100, we see the full backdrop.
Let’s find a happy medium and set it back to 50 percent, so we see some of the backdrop along with the webcam footage. Now, let’s create some sort of interaction. The third and final block we haven’t discussed yet is a variable that detects the amount of motion. This variable measures motion on a scale from 0 (no motion) to 100 (maximum motion) under the sprite.
We can also detect motion based on the entire stage, but let’s stick with “video motion on this sprite.” To see how this scale works, we can turn on a reporter next to the block, which will show us the amount of motion happening. Right now, if nothing is happening, it fluctuates between 0 and 1. If I move, we can see the values increase to 20, 30, and even 100.
Now, let’s create a mini project to demonstrate how to use this new block. We’ll set it up so that when I move, the cat will meow. I’ll create a simple script that continuously checks if the video motion is greater than 20. If it is, we’ll have the cat meow by using the “play sound meow until done” block.
Let’s try this out. It’s working! We can hear the cat meowing when there’s enough motion. This is a simple example of how you might use the video sensing blocks to create small interactions in your Scratch project.
I hope this was helpful, and I look forward to seeing what you create with video sensing blocks!
—
This version removes informal language and personal identifiers while maintaining the instructional content.
Scratch – A programming language that lets you create your own interactive stories, games, and animations. – In Scratch, you can drag and drop blocks to make your characters move and talk.
Video – A recording of moving visual images that you can watch on a computer or other device. – We watched a video tutorial to learn how to code a simple game.
Sensing – A feature in programming that allows a program to detect changes in the environment, like mouse movements or key presses. – In our game, we used sensing blocks to make the character jump when we pressed the space bar.
Webcam – A camera connected to a computer that can capture video and images. – We used the webcam to take a picture for our digital project.
Motion – The action or process of moving or being moved, often used in programming to animate characters. – We added motion to our sprite so it could glide across the screen.
Transparency – A feature that makes part of an image or object see-through, allowing other elements to be visible behind it. – We adjusted the transparency of the background so the characters would stand out more.
Project – A collection of code, images, and sounds that work together to create a program or game. – Our class project was to design a simple animation using Scratch.
Block – A piece of code in Scratch that you can connect with other blocks to build a program. – We used a loop block to make the character repeat its dance moves.
Create – To make something new, like a program or game, using your ideas and skills. – I love to create new games and share them with my friends.
Fun – Enjoyable or entertaining, often used to describe activities that are both educational and amusing. – Coding in Scratch is fun because you can make your own stories and games.
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. |