gpt4 book ai didi

python - screen.blit 函数在 pygame 中不起作用

转载 作者:行者123 更新时间:2023-12-04 14:59:24 26 4
gpt4 key购买 nike

<分区>

import pygame, sys

WINDOW_SIZE = (900, 700)
screen = pygame.display.set_mode(WINDOW_SIZE, 0, 32)
pygame.display.set_caption('Pygame Program')
pygame.display.set_icon(pygame.image.load('spaceship (3).png'))

player_img = pygame.image.load('ClipartKey_738895_adobespark.png')
player_X = 130
player_Y = 750
def player():
screen.blit(player_img, (player_X, player_Y))

running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
sys.exit()
screen.fill((0, 200, 255))
player()
pygame.display.update()

我的 player() 函数不起作用。它没有显示任何错误,但屏幕仍然是空白的,上面什么也没有显示

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com