diff --git a/main.py b/main.py index 39052fe..75571f0 100755 --- a/main.py +++ b/main.py @@ -7,10 +7,10 @@ from source.state import mainmenu, screen, level if __name__=='__main__': # 控制状态机运行 game = tool.Control() - state_dict = { c.MAIN_MENU: mainmenu.Menu(), + state_dict = { c.MAIN_MENU: mainmenu.Menu(), c.GAME_VICTORY: screen.GameVictoryScreen(), - c.GAME_LOSE: screen.GameLoseScreen(), - c.LEVEL: level.Level() + c.GAME_LOSE: screen.GameLoseScreen(), + c.LEVEL: level.Level() } game.setup_states(state_dict, c.MAIN_MENU) game.run() diff --git a/source/constants.py b/source/constants.py index bf5d3dc..8ab6161 100755 --- a/source/constants.py +++ b/source/constants.py @@ -639,4 +639,4 @@ CHOOSE = 'choose' PLAY = 'play' # 无穷大常量 -INF = float("inf") +INF = float("inf") # python传递字符串性能较低,故在这里对inf声明一次,以后仅需调用即可 diff --git a/source/state/screen.py b/source/state/screen.py index c865f4d..a08793e 100644 --- a/source/state/screen.py +++ b/source/state/screen.py @@ -30,7 +30,7 @@ class Screen(tool.State): self.rect.y = 0 def update(self, surface, current_time, mouse_pos, mouse_click): - if(current_time - self.start_time) < self.end_time: + if (current_time - self.start_time) < self.end_time: surface.fill(c.WHITE) surface.blit(self.image, self.rect) else: