def turn(self, angle): amount = abs(angle) * turnConst if angle > 0: api.player_Action("turn-right", amount) else: api.player_Action("turn-left", amount)
def turnTo(self, target): angle = self.GetAngleTo(target) amount = abs(angle) * turnConst if angle > 0: api.player_Action("turn-right", amount) else: api.player_Action("turn-left", amount)
def move(self, target, ratio=0.5): distance = self.distance(target) * ratio if distance > distanceTolerance: api.player_Action("forward", int(distance * moveConst))
def move_frame(self): api.player_Action("forward", 16)
def strafe_frame(self, direction): if direction > 0: api.player_Action("strafe-right", 10) else: api.player_Action("strafe-left", 10)
def turn_frame(self, turn): if turn > 0: api.player_Action("turn-right", 5) else: api.player_Action("turn-left", 5)
def moveDistance(self, distance): api.player_Action("forward", int(distance * moveConst))
def shoot(self, target): api.player_Action("shoot", 1) api.player_Action("shoot", 1) api.player_Action("shoot", 1)