马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 flyps 于 2024-7-29 13:57 编辑
我在制作游戏时调用了下文的say函数,程序却卡住了,这是怎么回事import pygame
from pygame.locals import *
pygame.init()
Acolour = (255, 255, 255)
def changeC(colour, acolour = Acolour):
acolour = colour
def say(story, surface, size, afont, k, colour = Acolour):
Astory = list(story)
Bstory = ""
for i in Astory:
Bstory = "".join([Bstory, i])
pygame.draw.rect(surface, colour, (size[0]/2, size[1]/2, size[0], size[1]/4), 10)
surface.blit(afont.render(Bstory, True, colour), (size[0]/2, size[1]/2))
while not k[K_z]:
surface.blit(afont.render(Bstory, True, colour), (size[0]/2, size[1]/2))
pygame.time.delay(10)
|