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. Get Information About Other Sprites/Stage

Get Information About Other Sprites/Stage

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 908 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

    • 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
    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