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

2、2甲壳虫笔迹清理擦除,甲壳虫.pen_clear()

3、3颜色随机改变,1到1000,甲壳虫.pen_setPenColorToColor(random.randint(1, 1000))

4、4落笔效果,甲壳虫.pen_penDown()

5、5甲壳虫面向的方向,回到原点位置,甲壳虫.motion_pointindirection(180)甲壳虫.motion_gotoxy(0, 0)

6、6变量X,x = 0

7、7重复执行,一直到碰到鼠标指针位置,while not (甲壳虫.sensing_touchingobject("_mouse_")):

8、8甲壳虫移动X步,方向是右转15度,X加一,甲壳虫.motion_movesteps("x")甲壳虫.motion_turnright(15)
