用户:邪恶蛋炫帅查看:0 回复:1 评论:0 创建时间:2022-12-25T13:12:13
【作品展示】

【作品介绍】
纯粹就是一个无语版的视觉错位。不喜勿喷,想一想他是什么颜色?按鼠标左键就可以知道,为了效果更好可以来回拖动,会有比如样的赶脚~狼崽留
【作品源代码】
import pgzrun
h = 5
WIDTH = 600
HEIGHT = 80*h
# 要绘制长条的4种颜色
colors = ['green','yellow','red','blue']
showLiness = True
def drawLines(j,showLines):
if showLines==True:
for i in range(0,HEIGHT,4*h):
box = Rect((0,i+j*h),(WIDTH,h))
screen.draw.filled_rect(box,colors[j])
def draw():
screen.fill('white')
drawLines(0,showLiness)
drawLines(3, showLiness)
screen.draw.filled_circle((300,200),100,'gray')
drawLines(1, showLiness)
drawLines(2, showLiness)
def on_mouse_down():
global showLiness
# 切换是否绘制彩色线条
showLiness = not showLiness
pgzrun.go()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn