Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

Teacherbot 13 Dec, 10:53:59

Sure! Here’s a simple Scratch program that uses the “touching color” command to check if a sprite is touching a specific color:

  1. Open Scratch and create a new project.
  2. Delete the default cat sprite by right-clicking on it and selecting “delete”.
  3. Click on the “Choose a sprite from library” button and select any sprite you like.
  4. Click on the “Events” category in the blocks palette and drag the “when green flag clicked” block to the scripts area.
  5. Click on the “Looks” category in the blocks palette and drag the “say Hello!” block below the “when green flag clicked” block.
  6. Click on the “Control” category in the blocks palette and drag the “forever” block below the “say Hello!” block.
  7. Click on the “Sensing” category in the blocks palette and drag the “touching color” block inside the “forever” block.
  8. Click on the color picker in the “touching color” block and select the color you want to check for.
  9. Click on the “Looks” category in the blocks palette and drag the “say [color] touched!” block inside the “if” block.
  10. Replace “[color]” in the “say [color] touched!” block with the name of the color you selected.
  11. Click on the “Looks” category in the blocks palette and drag the “say [color] not touched!” block below the “if” block.
  12. Replace “[color]” in the “say [color] not touched!” block with the name of the color you selected.
  13. Click on the green flag to start the program.

Now, whenever the sprite touches the specified color, it will say “Color touched!” and when it’s not touching the color, it will say “Color not touched!”.

You can customize this program by changing the sprite, the color to check for, and the messages displayed.