def init(scriptConfig, engineConfig, userPreferences, loadingScreenGUI = None): global g_replayCtrl try: if constants.IS_DEVELOPMENT: autoFlushPythonLog() LOG_DEBUG('init') BigWorld.wg_initCustomSettings() Settings.g_instance = Settings.Settings(scriptConfig, engineConfig, userPreferences) CommandMapping.g_instance = CommandMapping.CommandMapping() from helpers import DecalMap DecalMap.g_instance = DecalMap.DecalMap(scriptConfig['decal']) from helpers import EdgeDetectColorController EdgeDetectColorController.g_instance = EdgeDetectColorController.EdgeDetectColorController(scriptConfig['silhouetteColors']) import SoundGroups SoundGroups.g_instance = SoundGroups.SoundGroups() import BattleReplay g_replayCtrl = BattleReplay.g_replayCtrl = BattleReplay.BattleReplay() g_replayCtrl.registerWotReplayFileExtension() try: import Vibroeffects Vibroeffects.VibroManager.g_instance = Vibroeffects.VibroManager.VibroManager() Vibroeffects.VibroManager.g_instance.connect() except: LOG_CURRENT_EXCEPTION() tutorialLoaderInit() BigWorld.callback(0.1, asyncore_call) MessengerEntry.g_instance.init() import items items.init(True, None if not constants.IS_DEVELOPMENT else {}) import ArenaType ArenaType.init() import dossiers1 dossiers1.init() import dossiers2 dossiers2.init() BigWorld.worldDrawEnabled(False) import LcdKeyboard LcdKeyboard.enableLcdKeyboardSpecificKeys(True) gui_personality.init(loadingScreenGUI=loadingScreenGUI) AreaDestructibles.init() MusicController.init() TriggersManager.init() RSSDownloader.init() g_postProcessing.init() try: from LightFx import LightManager LightManager.g_instance = LightManager.LightManager() import AuxiliaryFx AuxiliaryFx.g_instance = AuxiliaryFx.AuxiliaryFxManager() except: LOG_CURRENT_EXCEPTION() except Exception: LOG_CURRENT_EXCEPTION() BigWorld.quit() return
def fini(): LOG_DEBUG('fini') if OfflineMode.enabled(): return else: BigWorld.wg_setScreenshotNotifyCallback(None) if g_postProcessing is None: return g_critMemHandler.restore() g_critMemHandler.destroy() if constants.IS_CAT_LOADED: import Cat Cat.fini() MusicController.fini() if RSSDownloader.g_downloader is not None: RSSDownloader.g_downloader.destroy() connectionManager.onConnected -= onConnected connectionManager.onDisconnected -= onDisconnected MessengerEntry.g_instance.fini() g_postProcessing.fini() from helpers import EdgeDetectColorController if EdgeDetectColorController.g_instance is not None: EdgeDetectColorController.g_instance.destroy() EdgeDetectColorController.g_instance = None BigWorld.resetEntityManager(False, False) BigWorld.clearAllSpaces() if TriggersManager.g_manager is not None: TriggersManager.g_manager.destroy() TriggersManager.g_manager = None gui_personality.fini() tutorialLoaderFini() import LcdKeyboard LcdKeyboard.finalize() import Vibroeffects if Vibroeffects.VibroManager.g_instance is not None: Vibroeffects.VibroManager.g_instance.destroy() Vibroeffects.VibroManager.g_instance = None if g_replayCtrl is not None: g_replayCtrl.destroy() from LightFx import LightManager if LightManager.g_instance is not None: LightManager.g_instance.destroy() LightManager.g_instance = None import AuxiliaryFx if AuxiliaryFx.g_instance is not None: AuxiliaryFx.g_instance.destroy() AuxiliaryFx.g_instance = None from predefined_hosts import g_preDefinedHosts if g_preDefinedHosts is not None: g_preDefinedHosts.fini() voipRespHandler = VOIP.getVOIPManager() if voipRespHandler is not None: VOIP.getVOIPManager().destroy() import SoundGroups SoundGroups.g_instance.destroy() Settings.g_instance.save() return
def __init__(self, game_area): width = 500 height = 500 cols = 3 rows = 3 self.mimic_area = MimicArea.MimicArea( (game_area[0] / 2) - (width / 2), (game_area[1] / 2) - (height / 2), width, height, rows, cols) self.music_controller = MusicController.MusicController() self.mimic = Mimic.Mimic(self.mimic_area.cells[0]) self.attack_controller = AttackController.AttackController() self.is_game_over = False self.is_paused = False self.game_active = False self.points = 0
def init(scriptConfig, engineConfig, userPreferences, loadingScreenGUI=None): global g_replayCtrl try: if constants.IS_DEVELOPMENT: autoFlushPythonLog() LOG_DEBUG('init') BigWorld.wg_initCustomSettings() Settings.g_instance = Settings.Settings(scriptConfig, engineConfig, userPreferences) CommandMapping.g_instance = CommandMapping.CommandMapping() from helpers import DecalMap DecalMap.g_instance = DecalMap.DecalMap(scriptConfig['decal']) from helpers import EdgeDetectColorController EdgeDetectColorController.g_instance = EdgeDetectColorController.EdgeDetectColorController( scriptConfig['silhouetteColors']) import SoundGroups SoundGroups.g_instance = SoundGroups.SoundGroups() import BattleReplay g_replayCtrl = BattleReplay.g_replayCtrl = BattleReplay.BattleReplay() g_replayCtrl.registerWotReplayFileExtension() try: import Vibroeffects Vibroeffects.VibroManager.g_instance = Vibroeffects.VibroManager.VibroManager( ) Vibroeffects.VibroManager.g_instance.connect() except: LOG_CURRENT_EXCEPTION() tutorialLoaderInit() BigWorld.callback(0.1, asyncore_call) MessengerEntry.g_instance.init() import items items.init(True, None if not constants.IS_DEVELOPMENT else {}) import ArenaType ArenaType.init() import dossiers1 dossiers1.init() import dossiers2 dossiers2.init() BigWorld.worldDrawEnabled(False) import LcdKeyboard LcdKeyboard.enableLcdKeyboardSpecificKeys(True) gui_personality.init(loadingScreenGUI=loadingScreenGUI) AreaDestructibles.init() MusicController.init() TriggersManager.init() RSSDownloader.init() g_postProcessing.init() try: from LightFx import LightManager LightManager.g_instance = LightManager.LightManager() import AuxiliaryFx AuxiliaryFx.g_instance = AuxiliaryFx.AuxiliaryFxManager() except: LOG_CURRENT_EXCEPTION() except Exception: LOG_CURRENT_EXCEPTION() BigWorld.quit() return