Kittenblock画笔基础,一个移动留下痕迹的甲壳虫scratch3.0 (.sb3)
# -*- coding: utf-8 -*-#Python中默认的编码格式是 ASCII 格式
import _env, time, random#导入模块
from kblock import *
Beetle = Sprite("Beetle")#甲壳虫
x = 0
Beetle.pen_penUp()#抬笔
Beetle.pen_clear()#擦除
Beetle.pen_setPenColorToColor("#FF0000")#设置笔的颜色
Beetle.pen_setPenSizeTo(3)#设置笔的粗细
while True:#当真的时候
Beetle.motion_goto("_mouse_")#甲壳虫移动跟随鼠标
if Beetle.sensing_mousedown():#如果鼠标按下
Beetle.pen_penDown()#如果落笔
else:#否则
Beetle.pen_penUp()#抬笔