Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 2D Blocks
  4. The "Touching ( )" Block

The "Touching ( )" Block

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 7.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • Working with Blocks

     

    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;">

    1 Reply Last reply
    0

    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
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode