用户:
ACARFDEFGZEHVDN查看:0 回复:1 评论:0 创建时间:2021-02-27T08:46:16
【作品展示】

【作品介绍】
Sorry
【作品源代码】
import pgzrun
WIDTH = 800
HEIGHT = 600
x = WIDTH/2
y = HEIGHT/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 y >= HEIGHT-r or y <= r:
speed_y = -speed_y
pgzrun.go()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn