The "Touching ( )" Block
CreatiCode last edited by creaticodeteacher2-mail
The “Touching ()” block is a boolean block in the sensing category.
The “Touching ( )” block is used to check if the sprite is touching the “mouse-pointer”, the “Edge” of the Stage or any other “Sprite”.
If the Sprite is touching the selected object, the block gives “true” answer; if it is not touching the selected object, the block gives false.
If you select “mouse-pointer” as the target object, the touching block will check if the mouse is touching the sprite. For example, in this program, the dog will say true or false based on whether the mouse is touching it.
If you select “edge” as the target object, the touching block will report whether the sprite is touching any of the 4 edges of the stage (highlighted in red).
If you select any other “sprite” as the target object, the touching block will check if it is touching the given sprite.
Note: You need to have at least two sprites in the project before you can select another sprite from the list.