【发布时间】:2019-01-26 05:08:01
【问题描述】:
所以。这个:
import pygame
import time
import random
import sys
itworks = True
pygame.init()
screen = pygame.display.set_mode((600, 600))
bootpng = pygame.image.load('bootimage.png')
bootpng = pygame.transform.scale(bootpng, (600, 600))
backgroundmenu = pygame.image.load('Menu_background.png')
backgroundmenu = pygame.transform.scale(backgroundmenu, ((600, 600))
button = pygame.image.load('technical_information_button')
button = pygame.transform.scale(infobut, ((130, 80))
screen.blit(bootpng, (0, 0))
time.sleep(3)
while itworks == True:
screen.blit(backgroundmenu, (0, 0))
screen.blit(tekbutton, (470, 520))
for event in pygame.event.get():
if ecent.type == pygame.QUIT:
itworks = False
# if event.type == pygame.MOUSEBUTTONDOWN:
# Set the x, y postions of the mouse click
#x, y = event.pos
#if ball.get_rect().collidepoint(x, y):
pygame.display.flip()
pygame.quit()
是我的代码。 Buuut .. 出于某种原因,python 在变量按钮第 15 行*处说“无效语法”。我真的不知道该怎么办,我尝试了很多东西,所以我希望我能从这里得到帮助:D
【问题讨论】:
标签: python variables syntax pygame syntax-error