用户:
兰镜嘉策(兰局兰段HXD3D-0177)查看:0 回复:0 评论:0 创建时间:2022-08-17T17:46:14
【作品展示】

【作品介绍】
第2版
【作品源代码】
import pygame
pygame.init()
bin = pygame.image.load('bin.jpeg')
k = pygame.image.load('k.jpeg')
b738 = pygame.image.load('b738.jpeg')
a = 0
picture = [bin, k, b738]
picture_num = [(640, 640), (780, 426), (600, 400)]
screen = pygame.display.set_mode((picture_num[a]))
# screen.blit(picture[a], (0, 0))
while True:
screen.blit(picture[a], (0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_f:
a += 1
if a > 2:
a = 0
screen = pygame.display.set_mode((picture_num[a]))
screen.blit(picture[a], (0, 0))
pygame.display.update()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn