0
나는 pygame, easygui 및 shelve로 파이썬에서 간단한 레이싱 게임을 만들었습니다. 게임을 끝내면 유휴 상태와 .desktop 파일에서 모두 훌륭하게 작동했습니다. 그 후 나는 최고 점수 시스템을 추가하기로 결정했습니다. 시스템은 유휴 상태에서 훌륭하게 작동하지만 .desktop 파일에서 "치명적인 파이썬 오류 : (파이 게임 낙하산) 분할 오류"라는 오류가 발생합니다. 나는 정말 그렇게 도움이 될 것이다 게임에서 최고 점수 시스템을 떠나고 싶습니다 appreciated.`Shelve가 파이 게임의 치명적인 오류를 유발합니까?
if hero.colliderect(finishline):
starttimer=0
running=0
d=shelve.open('highscores.txt')
highscore=d['highscore']
if time<highscore:
d=shelve.open('highscores.txt')
d['highscore']=time
player=easygui.enterbox(msg=("Congratulations you have set the new highscore of "+str(time)+ " please enter your name"))
d['player']=player
d.close
if time>highscore:
d=shelve.open('highscores.txt')
player=d['player']
highscore=d['highscore']
d.close
easygui.msgbox(msg=("Congratulations you have finished with a time of "+str(time)+" The highscore is "+str(highscore)+ "set by "+player))
`
내 게임에서이 기능을 사용 해 주셔서 감사합니다. –