def game_loop(): datingsim.checkinit() global in_game_loop, stop_request, stack, basescene in_game_loop = True stop_request = False while not stop_request: print(stack) if len(stack) == 0: # TODO: how to open worldmap multiple times # TODO: update worldmap to add Scenes to stack rather than directly calling main_loop if base_scene: base_scene.done = False base_scene.main_loop() base_scene.ath() else: next_scene = stack[-1] print("Next scene will be: " + str(next_scene)) next_scene.done = False next_scene.main_loop() next_scene.ath() in_game_loop = False datingsim.quit() pygame.quit() quit()
def finish(): """Requests that the game_loop stops on the next iteration. If currently in \ world map, then stops almost immediately. If currently in some scene, \ then stops after the current main_loop() exits.""" datingsim.checkinit() global stop_request stop_request = True