所以,我正在制作两个非常相似的游戏(具体细节现在无关紧要。)
无论如何,我需要知道在哪里插入我的“pygame.time.wait”代码。
我需要的确切代码如下所示:
pygame.time.wait(100)
score = score + 1
目前,我的代码如下所示:
import sys, pygame
from pygame.locals import *
pygame.init()
size = width, height = 800,500
screen = pygame.display.set_mode(size)
pygame.display.set_caption("One Score (Created by - Not Really Working Lamp Productions:)")
WHITE = (255,255,255)
score = 0
screen.fill (WHITE)
myfont = pygame.font.SysFont("monospace", 16)
scoretext = myfont.render("Score = "+str(score), 1, (0,0,0))
screen.blit(scoretext, (5, 10))
disclaimertext = myfont.render("Copyright, 2013, Not Really Working Lamp Productions.", 1, (0,0,0))
screen.blit(disclaimertext, (5, 480))
while 1:
for event in pygame.event.get():
pygame.display.flip()
if event.type == pygame.QUIT:sys.exit()
问题是,我不知道我应该把我的 pygame.time.wait 代码放在哪里。有人可以填我吗?(我认为它进入了“while 1:”循环,但我不知道在哪里。)