Navigation

    CreatiCode Scratch Forum

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

    Get Information About Other Sprites/Stage

    2D Blocks
    1
    1
    192
    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

      • Using spheres

       
       

      Introduction

      You can use the following sensing block to get information about another sprite or the stage:

       
       

      The Target Dropdown

      The second input allows you to select a target object, which can be another sprite in this project, or the stage.

      For example, in this project, there are 3 sprites “Cody”, “Apple” and “Avery”. If we are adding this block in the “Cody” sprite, we will see the other 2 sprites listed in the dropdown together with “Stage”:

      Note that the “Cody” sprite itself is not on this list. That’s because we can use other ways to get information about this sprite itself, such as its x and y positions.

       
       

      The Property Dropdown

      The first input allows you to choose a property you would like to know about, such as its position or costume information. Note that this list is different if you choose the stage as the target, because the stage can not move.

       
       

      Demo

      Suppose we want the Cody sprite to always stay below the Apple sprite. We can add some code in the Cody sprite to repeatedly move it to the same X position as the Apple sprite, but a slightly lower Y position:

      If we move the Apple sprite, then Cody will follow aumatically:

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