如何克隆猫咪



执行上面的代码,当绿旗被点击是我们的原角色会先克隆自己,然后颜色特效增加25,再向前移动100步。


克隆体会继承原角色xy坐标、颜色特效、方向、当前显示或隐藏的性质,当然最重要的是克隆体会继承原角色的全部脚本。为了更好的理解这个概念,我们继续执行下面一段代码。


当按下空格键时,原角色会克隆自己,克隆体启动时,会面向0°~360°之间随机一个方向重复执行移动3步碰到边缘就反弹。当我们第二次按下空格键时,会出现四只喵咪,但是这不是我们一般编写游戏想要的结果,我们只想原角色负责克隆,克隆体不产生克隆体的效果,执行下面的程序就能解决我们的问题。


小朋友们你们明白了吗~~赶紧打开Scratch运行程序吧!
在这个充满无限可能性的世界
晓爱和你一起迎接人工智能时代
培养计算思维和创新解难能力的
同时也为祖国科技兴国贡献一份力量
后记,小编朋友公司研发了一个游戏化的少儿编程在线课程(5-12岁),游戏化教学结合scratch(一款在线少儿编程工具,类似乐高的积木拼搭),我家娃娃学了几次课,非常喜欢(超预期),16次课才200多块钱,对锻炼孩子的思维能力和动手动力很有帮助。
声明:转载此文是出于传递更多信息之目的。若有来源标注错误或侵犯了您的合法权益,请作者持权属证明与本网联系,我们将及时更正、删除,谢谢。