Browse Source

isAirborne

Dave Schuyler 22 years ago
parent
commit
0f2c0a09c1
1 changed files with 7 additions and 17 deletions
  1. 7 17
      direct/src/showbase/GravityWalker.py

+ 7 - 17
direct/src/showbase/GravityWalker.py

@@ -307,13 +307,15 @@ class GravityWalker(DirectObject.DirectObject):
             onScreenDebug.add("impact", self.lifter.getImpactVelocity()) #*#
             onScreenDebug.add("impact", self.lifter.getImpactVelocity()) #*#
 
 
             onScreenDebug.add("velocity", self.lifter.getVelocity()) #*#
             onScreenDebug.add("velocity", self.lifter.getVelocity()) #*#
+            onScreenDebug.add("isAirborne", self.isAirborne) #*#
             onScreenDebug.add("jump", jump) #*#
             onScreenDebug.add("jump", jump) #*#
         if self.lifter.isOnGround():
         if self.lifter.isOnGround():
-            if self.falling:
-                self.falling = 0
+            if self.isAirborne:
+                self.isAirborne = 0
                 impact = self.lifter.getImpactVelocity()
                 impact = self.lifter.getImpactVelocity()
                 if impact < -30.0:
                 if impact < -30.0:
-                    messenger.send("jumpHardLand")
+                    #messenger.send("jumpHardLand")
+                    messenger.send("jumpLand")
                     self.startJumpDelay(0.1)
                     self.startJumpDelay(0.1)
                 else:
                 else:
                     messenger.send("jumpLand")
                     messenger.send("jumpLand")
@@ -325,9 +327,9 @@ class GravityWalker(DirectObject.DirectObject):
                 # enough to the ground to jump.
                 # enough to the ground to jump.
                 self.lifter.addVelocity(self.avatarControlJumpForce)
                 self.lifter.addVelocity(self.avatarControlJumpForce)
                 messenger.send("jumpStart")
                 messenger.send("jumpStart")
-                self.falling = 1
+                self.isAirborne = 1
         else:
         else:
-            self.falling = 1
+            self.isAirborne = 1
         #    if self.lifter.getAirborneHeight() > 10000.0:
         #    if self.lifter.getAirborneHeight() > 10000.0:
         #        assert(0)
         #        assert(0)
 
 
@@ -410,18 +412,6 @@ class GravityWalker(DirectObject.DirectObject):
         if __debug__:
         if __debug__:
             self.ignore("control-f3") #*#
             self.ignore("control-f3") #*#
 
 
-    def enableAvatarJump(self):
-        """
-        Stop forcing the jump key to return 0's
-        """
-        inputState.unforce("jump")
-
-    def disableAvatarJump(self):
-        """
-        Force the jump key to return 0's
-        """
-        inputState.force("jump", 0)
-
     
     
     if __debug__:
     if __debug__:
         def debugPrint(self, message):
         def debugPrint(self, message):