def newGameThread(self): print("Trying to start new game") self.cleanState() # resets GUI state importlib.reload(ants) # resets ants, e.g. with newly implemented Ants self.makeHooks() self.winner = ants_strategies.start_with_strategy( gui.args, gui.strategy, ants) self.gameOver = True self.saveState("winner", self.winner) self.saveState("gameOver", self.gameOver) # self.killGUI() update()
def newGameThread(self): print("Trying to start new game") self.cleanState() # resets GUI state importlib.reload(ants) # resets ants, e.g. with newly implemented Ants self.makeHooks() self.winner = False try: self.winner = ants_strategies.start_with_strategy( gui.args, gui.strategy) except: print( "Got that gosh darn error again. Bees win, I think? Go eat some cheese." ) self.gameOver = True self.saveState("winner", self.winner) self.saveState("gameOver", self.gameOver) # self.killGUI() update()
def run(*args): ants.Insect.reduce_armor = class_method_wrapper(ants.Insect.reduce_armor, pre=print_expired_insects) ants_strategies.start_with_strategy(args, AntsGUI().strategy)
def run(*args): Insect.reduce_armor = class_method_wrapper(Insect.reduce_armor, pre=print_expired_insects) start_with_strategy(args, interactive_strategy)