修复小游戏完成后不能进入冒险模式的bug

This commit is contained in:
星外之神 2022-04-14 08:58:52 +08:00
parent 62c5733817
commit b1e5a6fc26
2 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class Level(tool.State):
def loadMap(self):
modeList = ['adventure', 'littleGame']
if c.LITTLEGAME_BUTTON in self.game_info:
if c.LITTLEGAME_BUTTON in self.game_info and self.game_info[c.LITTLEGAME_BUTTON]:
map_file = 'littleGame_' + str(self.game_info[c.LITTLEGAME_NUM]) + '.json'
mode = 'littleGame'
else:

View File

@ -63,6 +63,7 @@ class Menu(tool.State):
y >= self.option_rect.y and y <= self.option_rect.bottom):
self.option_clicked = True
self.option_timer = self.option_start = self.current_time
self.persist[c.LITTLEGAME_BUTTON] = False
return False
# 点击到按钮修改转态的done属性
@ -81,6 +82,7 @@ class Menu(tool.State):
y >= self.option_littleGame_rect.y and y <= self.option_littleGame_rect.bottom):
self.done = True
# 确实小游戏还是用的level
# 因为目前暂时没有生存模式和解谜模式,所以暂时设置为这样
self.persist[c.LITTLEGAME_BUTTON] = True
def update(self, surface, current_time, mouse_pos, mouse_click):