Kittenblock实例,甲壳虫画画

时间:2026-02-15 17:03:50

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实例,甲壳虫画画

© 2026 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com