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. 知识库
  3. 二维积木
  4. 获取其他角色和舞台的信息

获取其他角色和舞台的信息

Scheduled Pinned Locked Moved 二维积木
1 Posts 1 Posters 756 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.
  • C Offline
    C Offline
    creaticodeteacher2-mail
    wrote on last edited by admin
    #1

     

    先修科目

    • 球体的使用

     
     

    介绍

    你可以用以下侦测积木获取其他角色、舞台的信息:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f761129f-5156-4367-bdf0-e3646fae9f6f.png" width="600" style="">

     
     

    目标对象下拉菜单

    第一个下拉菜单用于选择目标对象,目标对象可以是项目中的其他角色,也可以是舞台。

    例如,在这个项目中有3个角色——科迪、苹果和天瑞。如果在角色科迪中加入这个积木,就可以查看下拉列表中的其他2个角色以及舞台:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dc0a890e-0c7c-46f0-85d8-981743cd9aed.png" width="600" style="border-radius: 5px; border: 1px solid #29622d;">

    注意,科迪本身不在这个下拉列表中。因为我们可以用其他方法获取本角色的信息,例如x坐标、y坐标。

     
     

    属性下拉菜单

    第二个下拉菜单用来选择你要获知的属性,比如位置、造型信息。注意,如果目标对象选择的是舞台,这个下拉列表就不一样,因为舞台不能移动。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/06289677-abf1-47ae-8513-635b5f288de3.png" width="500" style="">

     
     

    范例

    假设我们想让科迪始终位于苹果下方。我们可以在科迪角色中加入代码,使科迪重复不断地移动到苹果的相同x坐标,y坐标的稍低位置:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dc36e930-7312-45bf-843f-db427a72d94e.png" width="500" style="">

    当我们移动苹果,科迪会自动跟随:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4cf8622b-cda3-47a9-827e-f83d9f3c79eb.gif" width="500" 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