• 为你的精灵添加另一个 。如果你愿意的话,这是将他/她离开控制台的好时机。
  • 使用 Ask 询问用户一个问题。将变量命名为存储答案 transition3
  • 使用 Set Text 来在控制台上展示用户的转换词输入,作为你故事的一部分。

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("park") sprite = codesters.Sprite("person3") sprite.glide_to(-100, 50) # text = codesters.Text("text", x, y, "color") text = codesters.Text("I went to the park!", 0, -200, "blue") stage.wait(1) sprite.move_right(400) transition1 = sprite.ask("Choose a transition from the sequence category.") text.set_text(transition1) sprite.move_left(200) stage.set_background("underwater") text.set_text("I like turtles.") stage.wait(2) transition2 = sprite.ask("Enter another word") text.set_text(transition2) stage.set_background("jupiter") text.set_text("Then I was in space!") stage.wait(2)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)