Challenge 2: Debug the program so that the sprite gets more points.

  • Click Run and read the error message.
  • Debug the program and click Run again to check your work.

Hint: Programs read code from top to bottom. We must tell the program what the value of points is before we use it.

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

stage.set_background("mars") sprite = codesters.Sprite("alien2") sprite.go_to(-100, -100) points += 1 points = 0 score_board = codesters.Display(points) sprite.say("Score!")
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)