Eng:Color () is Touching ()? (block)

The Color is Touching ? block is a Sensing block and a Boolean block. The block checks if a color on its sprite is touching another color; if the color on its sprite is touching the color, the block returns true; if it is not, it returns false.

The color in a color square can be chosen by clicking on the color square and then clicking anywhere in the Scratch editor. In versions of Scratch before 1.2, this block was called Color is Over ?.

Example Uses
As this block detects if a color on its sprite is touching a color, it is widely used in collision detecting.

Some common uses for the Color is Touching ? block:
 * Moving a sprite until a color on its sprite touches a color

repeat until  point towards [Sprite2 v] move (10) steps end


 * Making a sprite do things if a part of a sprite touches a color; for example, if the sprite's mouth touches blue (water), it drinks some water

forever if  then switch to costume [drinking water v] wait (1) secs switch to costume [not drinking water v]


 * Stopping bullets when they hit walls of a specific color

forever if  then hide


 * In a maze, sensing if a sprite has hit a dead-end

forever if  then say [Uh-oh, I hit a dead end!] for (2) secs