Scratch + AI
Turn your idea into real Scratch blocks with Coco, put your own trained AI inside Scratch with Teachable Machine, and try a Scratch mission for every Cocoon Kids level.
Describe your Scratch project
Coco suggests the blocks. Then you open Scratch and build it with your own hands.
How to build it
Now build it for real. Open Scratch, add the sprites, and drag the blocks in. When it works, tap the button.
This is the Scratch project written as words. Every block is one line. A program is just a list of instructions like this, and the pictures are drawn from the words.
Put your own AI inside a Scratch game
In Teach-a-Robot you trained a robot to see. Now train one in Google's Teachable Machine and plug it into Scratch, so your game reacts to your hand, your face or your voice. Grown-up tip: this uses free tools from Google and Stretch3, and works best in Chrome on a laptop.
Open Teachable Machine, choose Image project, then Standard image model. Make two classes, for example Thumbs up and Fist. Hold each class's button to record about 30 pictures. Press Train model.
Open Teachable Machine ↗Press Export model, then Upload my model. Copy the link it gives you. That link is your robot's brain living on the internet.
Open Stretch3, a copy of Scratch that can load extra blocks. Click the blue Add extension button at the bottom left and choose TM2Scratch.
Open Stretch3 ↗Paste your link into the image classification model URL block and click the block once.
Use the when received image label hat block. Here is a starter:
when received image label [Thumbs up v] :: extension change y by (60) wait (0.3) seconds change y by (-60) when received image label [Fist v] :: extension say [Stop!] for (1) seconds
🔍 Look inside: what is really happening?
Teachable Machine turns every picture into a long list of numbers. When you train, it learns which numbers go with Thumbs up and which go with Fist. Stretch3 downloads that brain and checks your webcam a few times a second. When one label wins, it fires the when received image label block, just like a key press. For words instead of pictures, try Machine Learning for Kids.
Finished a Cocoon Kids level? Take the idea into Scratch. Each mission shows the blocks to start with. Build it, then tick it off.