Example #1
0
    def interpolate(self, prev_obj, next_obj, alpha):
        super(Shot, self).interpolate(prev_obj, next_obj, alpha)
        self.direction = function.interpolate_angle(prev_obj.direction,
                                                    next_obj.direction, alpha)

        self.flight_time = prev_obj.flight_time + (
            next_obj.flight_time - prev_obj.flight_time) * alpha
Example #2
0
 def interpolate(self, prev_obj, next_obj, alpha):
     # Since the great majority of the attributes are binary, just mass copy
     if alpha < 0.5:
         obj = prev_obj
     else:
         obj = next_obj
     self = obj.copy()
     
     # Then deal with the few vars that aren't binary
     self.respawntimer = prev_obj.respawntimer + (next_obj.respawntimer - prev_obj.respawntimer)*alpha
     self.aimdirection = function.interpolate_angle(prev_obj.aimdirection, next_obj.aimdirection, alpha)
Example #3
0
    def interpolate(self, prev_obj, next_obj, alpha):
        # Since the great majority of the attributes are binary, just mass copy
        if alpha < 0.5:
            obj = prev_obj
        else:
            obj = next_obj
        self = obj.copy()

        # Then deal with the few vars that aren't binary
        self.respawntimer = prev_obj.respawntimer + (
            next_obj.respawntimer - prev_obj.respawntimer) * alpha
        self.aimdirection = function.interpolate_angle(prev_obj.aimdirection,
                                                       next_obj.aimdirection,
                                                       alpha)
Example #4
0
 def interpolate(self, prev_obj, next_obj, alpha):
     self.refirealarm = (1 - alpha) * prev_obj.refirealarm + alpha * next_obj.refirealarm
     self.direction = function.interpolate_angle(prev_obj.direction, next_obj.direction, alpha)
Example #5
0
    def interpolate(self, prev_obj, next_obj, alpha):
        super(Shot, self).interpolate(prev_obj, next_obj, alpha)
        self.direction = function.interpolate_angle(prev_obj.direction, next_obj.direction, alpha)

        self.flight_time = prev_obj.flight_time + (next_obj.flight_time - prev_obj.flight_time) * alpha
Example #6
0
 def interpolate(self, prev_obj, next_obj, alpha):
     self.refirealarm = (
         1 - alpha) * prev_obj.refirealarm + alpha * next_obj.refirealarm
     self.direction = function.interpolate_angle(prev_obj.direction,
                                                 next_obj.direction, alpha)