TUTORIALS Webcam control
Scratch sound and motion detection
SCRATCH
Our intrepid explorer Les Pounder has escaped from the planet of the evil space bats. But even in zero G he needs to lose a little weight.
OUR EXPERT
Les Pounder is associate editor at Tom’s Hardware and a freelance maker for hire. He blogs about his adventures and projects at bigl.es
YOU NEED
〉Raspberry Pi 4 or 400
〉Raspberry Pi OS
〉A USB webcam
〉Play it at https:// scratch.mit. edu/ projects/ 527621210
Continuing our series of Scratch projects, we’ve finally escaped from the planet of the snackstealing space bats and are recovering in our starship’s extensive leisure facilities. To be specific, we’re keeping fit in the astro-gym with Ball Blaster, a game where you punch balls to score points, but you only have 30 seconds! To control the game we use a webcam that will look for our hands and react when we hit a ball. To start the game we need to shout “GO” and then the countdown starts!
Plug in your USB webcam and it should just work. Scratch 3 should come pre-installed on your Raspberry Pi OS image, but just in case it’s missing it can be installed from the main menu, under Preferences> Recommended Software. Scratch 3 is found in the Programming category – place a tick in the box and click Apply to install. Once installed, Scratch 3 can be found in the main menu under Programming.