import pygame
# pygame游戏工具包
# 加载中。。 loading。。。初始化。。。。。
pygame.init()
# 窗口 display dis 分开 play 玩 ===》 展览,展示
ck= pygame.display.set_mode((600,600))
# 刷新 update 上 日期 升级,刷新
ball_x = 300
ball_y = 300
while 1 < 2:
# 写一个事件(event)===> 事件:就是对电脑的每一次操作(按键、鼠标)
for shi_jian in pygame.event.get():
# quit退出
if shi_jian.type == pygame.QUIT:
pygame.quit()
print(shi_jian)
# 设置背景颜色
ck.fill((135,206,250))
# 画画 draw;在哪里画;颜色;坐标,大小
ball_x=ball_x+1
# ball_y=ball_y+1
if ball_x > 600:
ball_x=0
pygame.draw.circle(ck,(14,241,210),(ball_x ,ball_y),30)
pygame.display.update()
weixuan -接小球游戏
最新推荐文章于 2022-08-11 00:47:58 发布