16 步:为了让我们的精灵围绕地球移动,我们将围绕中心旋转。

  • 单击主题选项卡,然后单击.
  • Rotate about Origin代码底部的循环内。
  • .rotate_origin()命令中的数字从45更改为变量rotate

请注意,所有精灵绕地球旋转 90 度!接下来,我们将让精灵在地球周围展开。

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

stage.set_background_color("lightblue") # sprite = codesters.Rectangle(x, y, width, height, "color") sprite = codesters.Rectangle(0, 0, 700, 100, "gold") sprite.turn_left(45) # sprite = codesters.Rectangle(x, y, width, height, "color") sprite = codesters.Rectangle(0, 0, 700, 100, "gold") sprite.turn_right(45) sprite = codesters.Sprite("earth") people_sprites = ['person1', 'person2', 'person3', 'person4', 'person5', 'person6', 'person7', 'person8','person9', 'person10', 'person11', 'person12'] rotate = 90 for value in people_sprites: # add code here sprite = codesters.Sprite(value) stage.wait(0.5) sprite.set_size(0.3) sprite.set_speed(5) sprite.move_forward(120) sprite.turn_right(90)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)