【发布时间】:2011-07-19 04:33:36
【问题描述】:
当我尝试运行以下程序时,收到语法错误通知:
balli = "ball.png"
backgroundi = "background.png"
import pygame , sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((500,500) , 0 , 32)
background = pygame.image.load(backgroundi).convert()
cursor = pygame.image.load(balli).convert_alpha()
while 1:
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 -= cursor.get_width()/2
y -= cursor.get_height()/2
screen.blit(cursor , (x,y))
pygame.display.update()
问题似乎仍然存在于以“x”开头的行和“x”本身。
【问题讨论】:
-
而 which 到底是什么错误?完整的回溯怎么样?
-
screen.blit(background , (0,0))
标签: python syntax python-3.x pygame