def __init__(self, direction, speed, life_time, game_object): super().__init__(game_object) self.life_time = life_time self.direction = direction self.speed = speed # self._start = time() self._start = InputManager.get_ticks()
def update(self, *args): if self._start + self.life_time * 1000 < InputManager.get_ticks(): # POSSIBLE MEMORY LEAK ???????? SceneManager.current_scene.remove_object(self.game_object) else: move = self.direction * self.speed * InputManager.get_delta_tick( ) / 1000 self.game_object.transform.move(move.x, move.y)