1
我有這個問題,當我想去遊戲結束屏幕。TypeError:'pygame.Surface'對象不可調用
Traceback (most recent call last):
File "C:\Users\MO\Desktop\Twerk\ballbounce_changed.py", line 215, in <module>
game()
File "C:\Users\MO\Desktop\Twerk\ballbounce_changed.py", line 191, in game
text("Game Over",30,white,300)
TypeError: 'pygame.Surface' object is not callable
這對於存在屏幕的代碼段:
while finish == True:
screen.blit(menu,[0,0])
text("Game Over",30,white,300)
text("Instructions",310,white)
text("-----------------------------------------------------",320,white)
text("Avoid the the enemies",340,white)
text("Last as long as you can!",360,white)
text("Press space to start",420,white)
# display.update()
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
repeat = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
repeat = True
if repeat == False:
pygame.quit()
else:
game()
game()
如果我刪除遊戲中的文字在屏幕上,它的工作。我只要我介紹的文字,我得到上面的錯誤消息
(縮進是不正確的),我有充分的代碼在這裏茚http://pastebin.com/VBkhX4kt
謝謝
謝謝,這是問題所在。 – ErHunt 2012-04-26 01:48:01