第14 步:让我们更改碰撞事件,以便根据宇航员击中的物体发生不同的事情!
- 找到该行: ···· my_var · = · hit_sprite 。 get_image_name()将变量从my_var更改为image 。
- 找到以下行: ···· if · my_var · == · "codesters" : ¬测试image是否等于"astronaut1" 。
这个碰撞事件检查宇宙飞船撞到了什么!如果hit_sprite的图像标签是"astronaut1" ,这个 if-block 将会运行。我们还将编写一个不同的 if 块,如果飞船撞到"ufo" ,它将运行!
To navigate the page using the TAB key, first press ESC to exit the code editor.