修复从游戏中返回主菜单时闪退的bug

This commit is contained in:
wszqkzqk 2022-07-27 19:50:04 +08:00
parent 17b91b2ae2
commit d227a28452

View File

@ -544,7 +544,8 @@ class Level(tool.State):
elif self.checkMainMenuClick(mouse_pos):
self.done = True
self.next = c.MAIN_MENU
self.persist = {c.CURRENT_TIME:0, c.LEVEL_NUM:self.persist[c.LEVEL_NUM], c.LITTLEGAME_NUM:self.persist[c.LITTLEGAME_NUM]}
self.persist = self.game_info
self.persist[c.CURRENT_TIME] = 0
# 播放点击音效
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "buttonclick.ogg")).play()