The "Touching ( )" Block
-
Prerequisite
Description
The “Touching ()” block is a boolean block in the sensing category.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/aaa06d69-9f24-4d9d-9601-53e112665488.PNG" width="750" style="">
How the “Touching ( )” Block Works?
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.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/bb3338e6-c890-4d76-8871-4bcebb899296.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Touching Mouse-pointer
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.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a497bd68-0741-444d-8c77-86c918df7d95.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Touching Edge
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).
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/61fb37c0-2fca-478c-9dca-254b97243065.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Touching Sprite
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.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a23ade67-aa0d-4106-a3cc-3e94d49e5ef3.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