1.课程回顾 #
碰撞侦测 #
如果苹果碰到大碗,那么移到()位置。
![](https://dashima.net/wp-content/uploads/2021/11/1636168929-image.png)
二维坐标 #
运动模块中,
X坐标、Y坐标,
可以作为判断角色位置的积木指令。
![](https://dashima.net/wp-content/uploads/2021/11/1636169014-image.png)
2.学习目标与任务 #
2.1 学习目标 #
学习 重复执行直到指令、面向“ ”。
熟练使用以下积木指令:条件判断、广播消息、比较运算符
![](https://dashima.net/wp-content/uploads/2021/11/1636169299-image.png)
2.2 课堂任务 #
![](https://dashima.net/wp-content/uploads/2021/11/1636169250-image.png)
小狗追足球
小狗狗看到从操场滚过来一个足球,
它迅速地向足球跑去,想要追上它。
我们来一起完成这个好玩的游戏吧!
2.3 作品分析 #
1.观察有哪些角色呢?
2.足球是如何运动的?
3.小狗什么时候跑向足球的?
3.编程思路与步骤 #
3.1 编程思路 #
![](https://dashima.net/wp-content/uploads/2021/11/1636169334-image.png)
3.2 编程步骤 #
(1)足球的程序
•初始化-移到舞台底部;
•向舞台上方滚动-Y坐标增加、旋转。
![](https://dashima.net/wp-content/uploads/2021/11/1636169383-image.png)
![](https://dashima.net/wp-content/uploads/2021/11/1636169406-image.png)
(2)足球停止移动
•足球一直移动到大于Y坐标的某一个值
•并发出广播消息
![](https://dashima.net/wp-content/uploads/2021/11/1636169518-image.png)
![](https://dashima.net/wp-content/uploads/2021/11/1636169532-image.png)
(3)小狗初始化
•让小狗最开始出现在树林中
•并设置成合适的大小
![](https://dashima.net/wp-content/uploads/2021/11/1636169608-image.png)
(4)小狗跑向足球
• 小狗收到消息后,面向足球移动;
• 当碰到足球后,停止全部程序。
![](https://dashima.net/wp-content/uploads/2021/11/1636169697-image.png)
![](https://dashima.net/wp-content/uploads/2021/11/1636169700-image.png)
4.问答与练习 #
![](https://dashima.net/wp-content/uploads/2021/11/1636169802-image.png)
Q1:左边是小鹏写的足球的程序,
程序运行后小狗和足球同时移动,
这是为什么呢?
Q2:右边是小鹏写的小狗的程序,
运行程序后,
小狗只跑了一段距离就不跑了,
有什么问题呢?
![](https://dashima.net/wp-content/uploads/2021/11/1636169849-image.png)
课后练习
让小狗追到足球后,足球消失掉!
![](https://dashima.net/wp-content/uploads/2021/11/1636169934-image.png)