Eng:Touching Color ()? (block)

The Touching Color ? block is a Sensing block and a Boolean block. The block checks if its sprite is touching the specified color. If the sprite is touching the color, the block returns "true"; triggering the rest of the script to continue. If it is not, it returns "false" the script remains neutral.

The color can be chosen by clicking on the block's color square, and then clicking anywhere in the Scratch project. For example, if the mouse was hovering over the color: blue and was clicked the color square would turn blue.

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

Some common uses for the Touching Color ? block: repeat until  move (10) steps end if  then say [I found water!] for (2) secs end
 * Moving a sprite until it touches a color
 * Making a sprite do things if it touches a color for example, if the sprite touches blue (water), it reacts in a specific way
 * 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 [Dead end!] for (1) secs


 * Making sprites not go through walls

forever if  then set [x velocity v] to (0)


 * Making Game End when touching color

forever if  then say [Game Over] for (1) secs broadcast [Game Over v]