Ejemplo n.º 1
0
 def __init__(self, evManager, model):
     self._em = evManager
     self._em.reg_cb(MBuiltMapEvt, self.start)
     self.model = model # TODO: move this into a model-dependent AI component 
     self.moves = [DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT]
     fps = config_get_fps()
     self.mvtimer = 0
     self.mvdelay = fps / config_get_movefreq()
     self.atktimer = 0
     self.atkdelay = fps / config_get_atkfreq()
Ejemplo n.º 2
0
def main():
    
    load_bot_config() # bot-specific config (e.g. logger)
    
    tid = current_thread().ident
    logger = config_logger(str(tid))
    
    logger.debug('Client started')
    
    evManager = ClientEventManager()

    clock = CClockController(evManager, config_get_fps()) #the main loop is in there
    g = Game(evManager)
    n = NetworkController(evManager, config_get_hostport(), config_get_nick())
    ic = BotInputController(evManager, g) # simulate inputs    
    
    clock.start()
    
    logger.debug('Client stopped')