代码运行后图片闪一下就没了
import pygame
class Bird():
def __init__():
pass
def Birdupdate(self):
pass
class Pipline():
def __init__():
pass
def updatePipline(self):
pass
def createmap():
backgroud = pygame.image.load('背景.jpg')
screen.blit(backgroud, (0, 0))
pygame.display.update()
if __name__=="__main__":
pygame.init()
size = width,height =500,750
screen = pygame.display.set_mode(size)
createmap()
没报错,但图片闪退
看网上要加while,但不大会加
求教导
要加上
def createmap():
backgroud = pygame.image.load('test.png')
screen.blit(backgroud, (0, 0))
while True:
for e in pygame.event.get():
if e.type == pygame.QUIT:
sys.exit()
elif e.type == pygame.KEYDOWN:
if e.key == pygame.K_ESCAPE:
sys.exit()
pygame.display.update()
等待响应
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!