Kittenblock实例,甲壳虫画画

2025-11-24 03:11:44

1、1选择甲壳虫角色,如图所示,甲壳虫 = Sprite("甲壳虫")

Kittenblock实例,甲壳虫画画

2、2甲壳虫笔迹清理擦除,

甲壳虫.pen_clear()

Kittenblock实例,甲壳虫画画

3、3颜色随机改变,1到1000,

甲壳虫.pen_setPenColorToColor(random.randint(1, 1000))

Kittenblock实例,甲壳虫画画

4、4落笔效果,

甲壳虫.pen_penDown()

Kittenblock实例,甲壳虫画画

5、5甲壳虫面向的方向,回到原点位置,

甲壳虫.motion_pointindirection(180)

甲壳虫.motion_gotoxy(0, 0)

Kittenblock实例,甲壳虫画画

6、6变量X,

x = 0

Kittenblock实例,甲壳虫画画

7、7重复执行,一直到碰到鼠标指针位置,

while not (甲壳虫.sensing_touchingobject("_mouse_")):

Kittenblock实例,甲壳虫画画

8、8甲壳虫移动X步,方向是右转15度,X加一,

 甲壳虫.motion_movesteps("x")

  甲壳虫.motion_turnright(15)

Kittenblock实例,甲壳虫画画

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢