def sit(self, speed=constants.DEFAULT_SPEED, wait=True): reset_grp = task.TaskGroup() # Front goes all the way up. reset_grp.add(self.front.legs.stand_up, (100.0, speed)) # Back goes all the way down. reset_grp.add(self.back.legs.stand_up, (0.0, speed)) reset_grp.start() reset_grp.join()
def __init__(self, *a, **k): super(StateManager, self).__init__(*a, **k) self._tasks = task.TaskGroup() self._events = EventManager() self._state_factory = {} self._state_stack = [] self._empty_count = 1
def stand_up(self, pct, speed=constants.DEFAULT_SPEED, wait=True): if not (0.0 <= pct <= 100.0): raise ValueError('Value out of range: %d%%' % pct) reset_grp = task.TaskGroup() reset_grp.add(self.right.stand_up, (pct, speed)) reset_grp.add(self.left.stand_up, (pct, speed)) reset_grp.start() reset_grp.join()
def _setup_logic(self): self._timer = Timer() self._tasks = task.TaskGroup() self._game_loop = get_game_loop() self._event_loop = EventLoop('screenshot', self._tf_window, self._game_loop, None) self._event_loop.signal_event.add(self.on_sfml_event) self._tasks.add(task.repeat(task.run(self._event_loop.loop_once)))
def __init__(self, state_manager=None, parent_state=None, *a, **k): assert state_manager != None super(State, self).__init__(*a, **k) self._tasks = task.TaskGroup() self._tasks.auto_kill = False self._state_manager = ref(state_manager) self._events = EventManager() self._parent_state = ref(parent_state) if parent_state else None
def __init__(self): super(PandaController, self).__init__() self._timer = Timer() self._timer.max_delta = self.DEFAULT_MAX_DELTA self._tasks = task.TaskGroup() self._tasks.add(self._panda_task) self._music = None self._mouse_task = None self._relative_mouse = False
def reset(self): reset_grp = task.TaskGroup() reset_grp.add(self.right.reset) reset_grp.add(self.left.reset) reset_grp.start() reset_grp.join()
def stand_up(self, pct, speed=constants.DEFAULT_SPEED, wait=True): bend_grp = task.TaskGroup() bend_grp.add(self.front.legs.stand_up, (pct, speed)) bend_grp.add(self.back.legs.stand_up, (pct, speed)) bend_grp.start() bend_grp.join()
def reset(self): reset_grp = task.TaskGroup() reset_grp.add(self.front.legs.reset) reset_grp.add(self.back.legs.reset) reset_grp.start() reset_grp.join()