def __init__(self, vector: Vector3, duration: float = 0.1, delay: float = 0.1): super().__init__() self.vector = vector.normalize() self.pitch = abs(self.vector[0]) * -sign(self.vector[0]) self.yaw = abs(self.vector[1]) * sign(self.vector[1]) self.delay = delay if delay >= duration else duration self.duration = duration # the time the jump began self.time = -1 # keeps track of the frames the jump button has been released self.counter = 0
def __init__(self, vector: Vector3, duration: float = 0.1, delay: float = 0.1, angle: float = 0, boost: bool = False): super().__init__() self.vector = vector.normalize() self.pitch = abs(self.vector[0]) * -sign(self.vector[0]) self.yaw = abs(self.vector[1]) * sign(self.vector[1]) self.delay = delay if delay >= duration else duration self.duration = duration self.boost = boost self.angle = math.radians(angle) if boost else 0 x = math.cos(self.angle) * self.vector.x - math.sin(self.angle) * self.vector.y y = math.sin(self.angle) * self.vector.x + math.cos(self.angle) * self.vector.y self.preorientation = Vector3(x, y, 0) # the time the jump began self.time = -1 # keeps track of the frames the jump button has been released self.counter = 0