不言自明。我的精灵没有出现,只有一个白框。我正在使用 Ubuntu 18.04.1 LTS 和 pygame 版本 1.9.3 如果您想知道的话,我正在使用 Simon Monk 在第 107 页的 Programming the raspberry pi 中的代码
import pygame
from pygame.locals import *
from sys import exit
spoon_x = 300
spoon_y = 300
pygame.init()
screen = pygame.display.set_mode((600,400))
pygame.display.set_caption('Raspberry Catching')
spoon = pygame.image.load('/home/john/PycharmProjects/pygame/spoon.png').convert()
while True:
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.fill((255,255,255))
spoon_x, ignore = pygame.mouse.get_pos()
screen.blit(spoon, (spoon_x, spoon_y))
pygame.display.update()