The "Touching Color ()" Block
-
Prerequisite
Description
The “touching color ()” block is a boolean block in the sensing category.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7c096924-646a-49ca-baaf-07b9c8bc316c.PNG" width="550" style="">
How does this block work?
This block tells us whether the current sprite is touching a color or not.
You can set the color by clicking on the color input of the block,
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/339e3d27-52cf-4591-8d9b-7b69d69107a3.PNG" width="180" style=""> and then slide the “Color” bar left or right to get the color of your choice.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d846c68b-dd6b-48d3-83a8-7498394b49c4.PNG" width="200" style="">
Here is an example:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/c07f006f-a051-4d5d-9842-6d06b16c43be.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Picking Color
You can also select the color directly using the “color picker” tool.
After you click the “color picker” tool, you can click at any point on the stage to use that point’s color.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7e026f28-e4bc-41bc-a820-ee004f14ac21.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Example - Racing Game
You can create a racing game with the “touching color ()” block as shown below. The dog keeps moving on the road until it touches the red finish line.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/82dfc78b-3238-4f80-802d-e84f9e091341.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login