第11步:我们将再次使用一个global变量来记录分数。

记住, global 允许我们更改事件中变量,这些变量是先前在程序中创建的。

  • 删除点击事件中的指令代码行 ····sprite.say("Hello,·name")
  • 点击 ,将 Global Variable 拖动到点击事件内部。将其缩进4个空格,并带有一个 ····
  • 将变量更改为 score


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

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)