暂无分类
暂无标签
发布于2019-10-28 16:15 阅读(1029) 评论(0) 点赞(23) 收藏(3)
0
1
2
3
4
5
# 1.导入工具包
import pygame
# 1.导入工具包
import pygame
import time
# 2.初始化
pygame.init()
# 3.设置窗口
screen = pygame.display.set_mode((700,600))
# 4,导入图片
ball = pygame.image.load('ball.png')
ball_x = 100
ball_y = 350
# 事件
while True:
for event in pygame.event.get():
print(event)
if event.type == pygame.QUIT:
pygame.quit()
screen.fill((230, 230, 230))
if ball_y > 600:
ball_y = 0
# ball_x = ball_x+1 # 修改横轴
ball_y=ball_y+1
# pygame.draw.circle(screen,(100, 210, 250),(300,350),70) # 三原色 red green blue 0-255
screen.blit(ball, (ball_x, ball_y))
pygame.display.update() # 4.刷新
# time.sleep(0.1)
pygame.quit() # 退出游戏
·
·
·
·
·
·
0
1
2
3
4
5
6
作者:9384vfnv
链接: https://www.pythonheidong.com/blog/article/147189/51aa369f62ac863f6fd5/
来源: python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
Copyright © 2018-2021 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系z452as@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!