Browse Source

- Lowered the strafing speed when walking backwards

Jason Yeung 19 năm trước cách đây
mục cha
commit
77ef27e6a1

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

@@ -460,7 +460,11 @@ class GravityWalker(DirectObject.DirectObject):
         # Slide speed is a scaled down version of forward speed
         # Slide speed is a scaled down version of forward speed
         # Note: you can multiply a factor in here if you want slide to
         # Note: you can multiply a factor in here if you want slide to
         # be slower than normal walk/run. Let's try full speed.
         # be slower than normal walk/run. Let's try full speed.
-        self.slideSpeed=(slideLeft and -self.avatarControlForwardSpeed*0.75 or
+        #self.slideSpeed=(slideLeft and -self.avatarControlForwardSpeed*0.75 or
+        #                 slideRight and self.avatarControlForwardSpeed*0.75)
+        self.slideSpeed=(reverse and slideLeft and -self.avatarControlReverseSpeed*0.75 or
+                         reverse and slideRight and self.avatarControlReverseSpeed*0.75 or
+                         slideLeft and -self.avatarControlForwardSpeed*0.75 or
                          slideRight and self.avatarControlForwardSpeed*0.75)
                          slideRight and self.avatarControlForwardSpeed*0.75)
         self.rotationSpeed=not (slideLeft or slideRight) and (
         self.rotationSpeed=not (slideLeft or slideRight) and (
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or

+ 5 - 4
direct/src/controls/NonPhysicsWalker.py

@@ -198,13 +198,14 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         self.speed=(forward and self.avatarControlForwardSpeed or
         self.speed=(forward and self.avatarControlForwardSpeed or
                     reverse and -self.avatarControlReverseSpeed)
                     reverse and -self.avatarControlReverseSpeed)
         # Should fSlide be renamed slideButton?
         # Should fSlide be renamed slideButton?
-        self.slideSpeed=slide and (
-                (turnLeft and -self.avatarControlForwardSpeed*0.75) or
-                (turnRight and self.avatarControlForwardSpeed*0.75))
+        self.slideSpeed=slide and ((reverse and turnLeft and -self.avatarControlReverseSpeed*(0.75)) or
+                                   (reverse and turnRight and self.avatarControlReverseSpeed*(0.75)) or
+                                   (turnLeft and -self.avatarControlForwardSpeed*(0.75)) or
+                                   (turnRight and self.avatarControlForwardSpeed*(0.75)))
         self.rotationSpeed=not slide and (
         self.rotationSpeed=not slide and (
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnRight and -self.avatarControlRotateSpeed))
                 (turnRight and -self.avatarControlRotateSpeed))
-
+        
     def handleAvatarControls(self, task):
     def handleAvatarControls(self, task):
         """
         """
         Check on the arrow keys and update the avatar.
         Check on the arrow keys and update the avatar.