示例#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
示例#2
0
文件: player.py 项目: PyGG2/PyGG2
 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)
示例#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)
示例#4
0
文件: weapon.py 项目: 0xluis/PyGG2
 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)
示例#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
示例#6
0
文件: weapon.py 项目: Orpheon/PyGG2-1
 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)