第20步:使用 if 以测试 name 是否等于你所选择僵尸的图像名称,例如 "zombie2"。
如果英雄与你的 "zombie" 相撞,则设置以下指令运行:
- 使用 Remove Sprite 将 hit_sprite 从控制台上移除。
- 使用 Say 让 sprite 说出 "ouch!"。
- 使用 Subtract Value 从 score 减去 1。并使用 Update Dispaly 以更新 score_board。
To navigate the page using the TAB key, first press ESC to exit the code editor.