In this video, you'll keep the Lens from describing anything but the model.
The code you created so far checks only to see if the color the lens is touching matchesthe color in any of the conditionals, or "if/then" blocks. That means if the backdrop for thesprite is purple... and the lens clicks on the backdrop, the Lens starts to say the textfor the purple shirt! This is a bug, or unexpected behavior, inthe code. As a computer program gets longer, with more code and more "if then" decisions,even the most experienced computer scientists are unable to predict every behavior thatwill happen. So, they test their code often and tinker with it to find and fix the bugs.
Fix this bug so the Lens shows text only when the Model sprite is clicked. Click the Controlmenu, drag out an "if/then" block, and place it around ALL "If/then" blocks that checkthe color being touched.
From the sensing menu, drag out a "touching" block, and place it in the "if/then" block.
Choose "Model" from the dropdown. Now, the code reads, *if* the lens is touching themodel, *then* run the other "If/then" blocks that check the color and show text. If thelens sprite is *not* touching the model sprite, the "if/then" blocks never run at all.
Try it out! Great! In this example, when the purple backdrop is clicked, the descriptionfor the shirt does *not* display. When the Model's purple shirt is clicked, the description*does* display. Add a backdrop for your sprite, too!
Lastly, give the user of your project instructions about how to explore. Click the Model sprite.
Use the "when flag clicked" block and “say” blocks to introduce your project and tellthe user how it works. Write your own introductory text. This is just an example.
Now, it's your turn! Add an "If touching Model" block around allthe color conditionals in your project so that the Lens does not describe the outfitwhen the backdrop is clicked. Add a backdrop to your project.
In the Model sprite, add instructions that tell the user how your project works.