最近才学的python,在网上找的贪食蛇游戏代码,运行的时候就出现错误
def gameOver():
gameOverFont = pygame.font.Font
('freesansbold.ttf', 72)
gameOverSurf = gameOverFont.render
('Game Over', True, greyColor)
gameOverRect = gameOverSurf.get_rect()
gameOverRect.midtop = (320, 10)
playSurface.blit(gameOverSurf, gameOverRect)
pygame.display.flip()
time.sleep(5)
pygame.quit()
sys.exit()具体错误在这一行gameOverRect = gameOverSurf.get_rect()后面代码调用函数gameOver()的时候报错AttributeError:'method_descriptor' object has no attribute 'get_rect'
请问大神们怎么解决,在线等!!!
添加回答
举报
0/150
提交
取消