用户:
玉eyLO查看:0 回复:0 评论:0 创建时间:2022-05-15T16:14:48
【作品展示】

【作品介绍】
大家好,我是第一次做Python编程语言。如有缺点,请多指教
【作品源代码】
import pgzrun
WIDTH=800
EIGHTH=600
x=WIDTH/2
y=EIGHTH/2
speed_x=3
speed_y = 5
r=30
def draw():
screen.fill('white')
screen.draw.filled_circle((x,y),r,'red')
def update():
global x,y,speed_x,speed_y
x=x+speed_x
y=y+speed_y
if x >= WIDTH-r or x <=r:
speed_x=-speed_x
if x >= WIDTH-r or x <= r:
speed_y=-speed_y
pgzrun.go()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn