如何删除IDEA中实时模板中的第一个和最后一个括号?
import pygame, sys, random
from pygame.locals import*
WINWIDTH = 1200
WINHEIGHT = 800
CARDTHUMBWIDTH = 50
CARDTHUMBHEIGHT = 80
FPS = 30
FPSCLOCK = pygame.time.Clock()
DISPLAYSURF = pygame.display.set_mode((WINWIDTH,WINHEIGHT))
pygame.display.set_caption('NBA Card Game')
pygame.init()
playerHandPos = [(17, 635), (75, 635), (133, 635), (191, 635), (249, 635), (307, 635), (365, 635), (423, 635), (481, 635), (539, 635)]
lakersDeck = ['Lakers_01.png', 'Lakers_02.png', 'Lakers_03.png', 'Lakers_04.png', 'Lakers_05.png', 'Lakers_06.png', 'Lakers_07.png', 'Lakers_08.png', 'Lakers_09.png', 'Lakers_10.png']
turnCount = 0
font = pygame.font.SysFont(None, 30)
userTextPrompt = "20, 725"
playMat = pygame.image.load('playmat.png')
detailBox = pygame.image.load('detailBox.png')
DISPLAYSURF.blit(playMat, (0,0))
def terminate():
pygame.quit()
sys.exit()
##def drawText(text, font, surface, x, y):
## textobj = font.render(text, 1, (0,0,0))
## textrect = textobj.get_rect()
## textrect.topleft = (x,y)
## surface.blit(textobj, textrect)
def getFirstHand():
random.shuffle(lakersDeck)
firstHand = [lakersDeck[0], lakersDeck[1], lakersDeck[2], lakersDeck[3]]
return firstHand
def displayHand():
cardThumb = pygame.image.load(playerHand[0])
cardThumb = pygame.transform.scale(cardThumb, (50,80))
DISPLAYSURF.blit(cardThumb, playerHandPos[0])
pygame.display.update()
def playerTurn():
placedBench = False
while placedBench == False:
drawText("Choose a card for your bench.", font, DISPLAYSURF, 20, 725)
pygame.display.update()
def cardLakers_01():
offense = 10
return offense
while True:
playerHand = []
mouse = pygame.mouse.get_pos()
print(mouse)
if turnCount == 0:
getFirstHand()
playerHand = getFirstHand()
turnCount += 1
displayHand()
playerTurn()
for event in pygame.event.get():
if event.type == QUIT:
terminate()
if event.type == KEYUP:
if event.key == K_ESCAPE:
terminate()
if event.type == MOUSEMOTION:
if 67 > mouse[0] > 17 and 710 > mouse[1] > 635:
cardDashImage = pygame.image.load('Lakers_01.png')
DISPLAYSURF.blit(cardDashImage, (925, 200))
pygame.display.update()
else:
detailBox = pygame.image.load('detailBox.png')
DISPLAYSURF.blit(detailBox, (900,0))
pygame.display.update()
FPSCLOCK
pygame.display.update()
pygame.display.update()
答案 0 :(得分:0)
打开实时模板是不可能的,因为它只是扩展了给定的代码。