当我试图运行以下程序时,我收到一个语法错误通知:
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”本身的那条线上。在
具体来说,
screen.blit(background , (0,0)
应该是screen.blit(background , (0,0))
。在上一行缺少
)
。在赋值只能是语句。在
快乐的编码。在
相关问题 更多 >
编程相关推荐