Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    The "Touching ( )" Block

    2D Blocks
    1
    1
    3572
    Loading More Posts
    • 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.
    • info-creaticode
      CreatiCode last edited by admin

       

      Prerequisite

      • Working with Blocks

       

      Description

      The “Touching ()” block is a boolean block in the sensing category.


       

      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.


       

      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.


       

      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).


       

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post