你好,我正在尝试为新波士顿学习 Pygame,我很难让第一个 leason 工作,每次我打开它都会崩溃,我已经尝试了一切,但我无法让它工作任何帮助都会很棒
这是我的代码
bif = 'bg.jpg'
mif = 'ball.png'
import pygame, sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640,360),0,32)
background = pygame.image.load(bif).convert()
mouse_c = pygame.image.load(mif).convert_alpha()
while true:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
screen.blit(background, (0,0))
x,y = pygame.mouse.get_pos()
x -= mouse_c.get_width()/2
y -= mouse_c.get_hight()/2
screen.blit(mouse_c,(x,y))
pygame.display.update()