def secondary_loop(): global _last_traceback, _fatal_error #It takes 0.6ms when with the editor. (Without tile replacing) try: if _fatal_error: return #Set scene if module.change_scene_frame == True: if module.change_scene_dynamic == True: dynamic.loadScene(None, None) else: utils.setScene(None) return else: if module.scene_behavior.paused == False: module.scene_behavior.update() module.scene_behavior.baseUpdate() if not module.scene_behavior: return #When removing the scene for b in module.scene_behavior.behaviors: if b.paused == False: b.update() if not module.scene_behavior: return #When removing the scene except: if not module.scene_behavior: return module.scene_behavior.paused = True s = traceback.format_exc() if s != _last_traceback: utils.debug("Error during runtime. Scene behavior suspended!") print(s) _fatal_error = True _last_traceback = s #It takes about 0.3ms (As much as the main loop) listen_list = [ x for x in module.listen_input_list if x._immuse_keyboard == True and x.scene == module.scene_game ] for x in module.listen_input_list: x._immuse_keyboard = x.use_keyboard event._key_event_loop(listen_list) module.window.secondary_update()
def secondary_loop(): global _last_traceback, _fatal_error #It takes 0.6ms when with the editor. (Without tile replacing) try: if _fatal_error: return #Set scene if module.change_scene_frame == True: if module.change_scene_dynamic == True: dynamic.loadScene(None, None) else: utils.setScene(None) return else: if module.scene_behavior.paused == False: module.scene_behavior.update() module.scene_behavior.baseUpdate() if not module.scene_behavior: return #When removing the scene for b in module.scene_behavior.behaviors: if b.paused == False: b.update() if not module.scene_behavior: return #When removing the scene except: if not module.scene_behavior: return module.scene_behavior.paused = True s = traceback.format_exc() if s != _last_traceback: utils.debug("Error during runtime. Scene behavior suspended!") print(s) _fatal_error = True _last_traceback = s #It takes about 0.3ms (As much as the main loop) listen_list = [x for x in module.listen_input_list if x._immuse_keyboard == True and x.scene == module.scene_game] for x in module.listen_input_list: x._immuse_keyboard = x.use_keyboard event._key_event_loop(listen_list) module.window.secondary_update()
def startGame(self): dynamic.loadScene("scene/intro.blend", "Intro")