Python 在一段时间后更改pygame中的图像

Python 在一段时间后更改pygame中的图像,python,image,background,pygame,Python,Image,Background,Pygame,嗨,我是这个网站的新手。 问题是 当前,程序显示一个图像,该图像应为启动屏幕,持续三秒。 然后,我希望它停止显示第一个图像,而连续显示另一个图像。 我使用的是pygame版本1.9.1和python版本2.7.9。 代码如下。 提前谢谢 import pygame, sys from pygame.locals import * pygame.init() gameDisplay=pygame.display.set_mode((600,600)) pygame.display.set_ca

嗨,我是这个网站的新手。 问题是

当前,程序显示一个图像,该图像应为启动屏幕,持续三秒。 然后,我希望它停止显示第一个图像,而连续显示另一个图像。 我使用的是pygame版本1.9.1和python版本2.7.9。 代码如下。 提前谢谢

 import pygame, sys
from pygame.locals import *
pygame.init()

gameDisplay=pygame.display.set_mode((600,600))
pygame.display.set_caption("Platypus")

white=255,255,255
black=0,0,0
red=255,0,0

important_platypus=pygame.image.load("C:/Users/Sarah_2/Pictures/no_one_knows_why_Duck_Billed_Platypi_are_important.jpg")
important_platypus=pygame.transform.scale(important_platypus,(600,600))

gameExit=False
while not gameExit:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            gameExit = True

    gameDisplay.blit(important_platypus, (0, 0) )

    pygame.display.update()

pygame.quit()
quit()

时间就是睡眠,功能就是你想要的。 请投赞成票 下面是完整的例子

 import pygame, sys 
 from pygame.locals import * 
 pygame.init() 
 gameDisplay=pygame.display.set_mo de((600,600))
 pygame.display.set_caption ("Platypus")
 time.sleep(3)
 gameDisplay=pygame.display.set_mo de((600,600)) 
 pygame.display.set_caption ("second image") 

这家伙投我一票。我没有做任何坏事。告诉我是谁干的……还有为什么,你是一个真正的救世主,我还不能投你一票,但当我有15岁的声望时,我会投你一票。