소스 검색

Damage to ship sails now decrease its speed

greytower 20 년 전
부모
커밋
abd1a41291
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      direct/src/controls/ShipPilot.py

+ 5 - 1
direct/src/controls/ShipPilot.py

@@ -89,7 +89,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
             #*# Debug:
             #*# Debug:
             if not hasattr(ship, "acceleration"):
             if not hasattr(ship, "acceleration"):
                 self.ship.acceleration = 60
                 self.ship.acceleration = 60
-                self.ship.maxSpeed = 12
+                self.ship.maxSpeed = 14
                 self.ship.reverseAcceleration = 10
                 self.ship.reverseAcceleration = 10
                 self.ship.maxReverseSpeed = 2
                 self.ship.maxReverseSpeed = 2
                 self.ship.turnRate = 3
                 self.ship.turnRate = 3
@@ -887,6 +887,10 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
                 speed *= self.ship.maxReverseSpeed
                 speed *= self.ship.maxReverseSpeed
 
 
         #speed *= 1.0 - dt * 0.05
         #speed *= 1.0 - dt * 0.05
+
+        # modify based on sail damage
+        speed *= self.ship.Sp
+        speed /= self.ship.maxSp
         physObject.setVelocity(speed)
         physObject.setVelocity(speed)
 
 
         #rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())
         #rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())