コード例 #1
0
ファイル: projectile.py プロジェクト: Orpheon/PyGG2-1
    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
ファイル: projectile.py プロジェクト: JerseyJackal/PyGG2-old
    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)