コード例 #1
0
    def turn(self, angle):
        amount = abs(angle) * turnConst

        if angle > 0:
            api.player_Action("turn-right", amount)
        else:
            api.player_Action("turn-left", amount)
コード例 #2
0
    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)
コード例 #3
0
 def move(self, target, ratio=0.5):
     distance = self.distance(target) * ratio
     if distance > distanceTolerance:
         api.player_Action("forward", int(distance * moveConst))
コード例 #4
0
 def move_frame(self):
     api.player_Action("forward", 16)
コード例 #5
0
 def strafe_frame(self, direction):
     if direction > 0:
         api.player_Action("strafe-right", 10)
     else:
         api.player_Action("strafe-left", 10)
コード例 #6
0
    def turn_frame(self, turn):

        if turn > 0:
            api.player_Action("turn-right", 5)
        else:
            api.player_Action("turn-left", 5)
コード例 #7
0
 def moveDistance(self, distance):
     api.player_Action("forward", int(distance * moveConst))
コード例 #8
0
 def shoot(self, target):
     api.player_Action("shoot", 1)
     api.player_Action("shoot", 1)
     api.player_Action("shoot", 1)