【发布时间】:2019-01-27 02:28:02
【问题描述】:
这是我正在制作的游戏的代码,我设法将第一个文本写入屏幕,然后它设法打印事件,但它不会运行代码的第二部分。我假设if event.type == pygame.K_RETURN:
不起作用。我要么做错了什么,要么它不起作用。
while True:
for event in pygame.event.get():
#print(event)
if event.type==pygame.KEYDOWN:
print("key pressed")
if event.type == pygame.K_RETURN:
print(event)
print("enter key pressed")
screen.fill(blue)
textSurf, textRect = text_objects(t2, smallText)
textRect.center = ((700),(100))
screen.blit(textSurf, textRect)
pygame.display.update()
pygame.display.update()
【问题讨论】:
标签: python python-3.x pygame