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 654 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/1e5ac67f-06bc-43dd-aa1a-fe1f71ac01d5.png" width="550" style="">
     

    这个积木怎么用?

    如果条件为真,这个积木就运行它嘴里的积木。如果条件为假,就忽略它嘴里的积木,并继续执行它下面的积木。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/ebf602ab-f0cf-4ffa-9c4c-657d5fe79bc0.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
     

    条件只检测一次

    积木“如果<>那么”只检测一次条件。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f255cd57-eb24-4bd5-94d7-c517b0035ce6.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
     

    嵌套积木“如果<>那么”

    如果你把一个积木“如果<>那么”放入另一个,它们就组成“嵌套”。 https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/cd2adc3e-cdb6-47f4-aa6c-e616a609cd68.png" width="150" style="">

    如果一个条件为真时,你又想检测另一个条件,就可以用嵌套积木“如果<>那么”。

    在如下示例中,第一个“如果<>那么”检测角色是否碰到角色“开始”。如果为真,第二个“如果<>那么”检测其x坐标是否大于10.如果两个条件都为真,角色就说“游戏开始!”。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/3fa0b446-fbb2-4723-a7ae-af15b25099f0.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
     

     

    多个积木“如果<>那么”

    为了同时检测多个条件,你可以叠放多个积木“如果<>那么”。

    在如下示例中,如果分数小于等于5,角色就说“伤心!”;如果分数大于等于10,角色就说“高兴!”。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b222beca-5f03-424f-8b28-e8c580d2926c.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