You can already train a pose model. Today you will load that model into Scratch and build a space game you steer by leaning left and right.
Before you change anything, look at the plan for the rocket and stars. How do you think a tilt pose will make the rocket move?
Open the project you saved earlier (or start fresh in Stretch3 as guided). You will predict, build, run, and fix as you go.
Keep this short. Confirm Stretch3 is open and cameras can be allowed. Optional predict: before anyone runs code, ask how a tilt pose might change the rocket’s x position. Do not restate prior lesson events; frame it as skills they already have. Pair students at devices and move quickly into the build.
In this lesson, you will create a fun Space game using Scratch and Google Teachable Machine.
You will learn how to use your Teachable Machine Pose model with tilt poses to control a spaceship.
If you don't have a Teachable Machine Image model, don't worry! You can use the provided model.
Read the lesson aim aloud. Stress they will connect a pose model (their own or the sample) to steer with tilt. If some lack a model URL, point them to the provided one so nobody is stuck. No code modelling yet.
Go to https://stretch3.github.io/ and start a new Scratch project and delete the Cat sprite.
Then, add the TMPose2Scratch extension by clicking on the Extensions button at the bottom left corner of the screen and selecting TMPose2Scratch. This extension allows you to use Google Teachable Machine pose models in your Scratch projects.
When you add this extension, it will automatically try and use your computer's camera. If necessary, click on 'Allow' to give it permission to use your camera. You should see what the camera is showing in the stage area.
Model on the board: open Stretch3, new project, delete the cat, add TMPose2Scratch, allow camera. Watch for blocked cameras or students on plain scratch.mit.edu instead of Stretch3. Differentiation: sit nearer anyone who struggles with extensions and confirm the stage shows the webcam view.
Add the Rocketship sprite to the project and then add the following code to it, to shrink it's size and position a the bottom center of the stage area.
when green flag clicked
set size to (40) %
go to x (0) y (-150)
Model adding the Rocketship and the green-flag setup for size and bottom-centre position. Common bug: sprite left at full size or wrong y so it sits off the play area. Ask: why start small and low before adding AI blocks?
Now, let's set up the pose model that our project will use. Add the following new code to your sprite:
when green flag clicked
set size to (40) %
go to x (0) y (-150)
pose classification model URL [link to your model] :: extension
Put the link of your pose model into the pose classification model URL block.
Model pasting the pose classification model URL on the same green-flag stack. Key question: what must be true about this link for labels to appear? Common bug: broken or incomplete URL, or spaces pasted in. Have the sample URL ready on the board for anyone without their own model.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.