- 帖子
- 2
- 精华
- 0
- 积分
- 16
- 阅读权限
- 10
- 注册时间
- 2015-10-12
- 最后登录
- 2016-2-16
|
- # coding = utf-8
- import pygame
- from sys import exit
- pygame.init()
- screen = pygame.display.set_mode((595,834),0,32)
- pygame.display.set_caption("Hello, Rain")
- back = ['datababy01.jpg','datababy02.jpg','datababy03.jpg','datababy04.jpg']
- background = pygame.image.load(back[0]).convert()
- i = 0
- while True:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- pygame.quit()
- exit()
- if event.type == pygame.MOUSEBUTTONDOWN:
- i += 1
- background = pygame.image.load(back[i % 4]).convert()
- screen.blit(background,(0,0))
- pygame.display.update()
复制代码 |
|