The "Touching Color ()" Block
-
Prerequisite
Description
The “touching color ()” block is a boolean block in the sensing category.
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, and then slide the “Color” bar left or right to get the color of your choice.
Here is an example:
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.
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.