示例#1
0
 protected virtual void switchState(IEntity entity, KeysPressed keysPressed, Gravity gravity, IGravityClient gravityClient)
 {
     if (!keysPressed.jump)
     {
         if (gravity.Y_velocity >= 0.0f && (gravityClient.getJumpForce() * 0.85f) > gravity.Y_velocity)
         {
             gravity.Y_velocity = -0.01f;
         }
     }
     if (gravity.isFalling() || gravity.isStanding())
     {
         gravity.Jumping = false;
         IBehaviourStateFactory behaviourStateFactory = entity.getBehaviourStateFactory();
         entity.setState(behaviourStateFactory.getFallState(entity));
     }
 }
示例#2
0
 public virtual void _reset(IGravityClient object_)
 {
     y_velocity = (jumping) ? object_.getJumpForce() : y_velocity_reset;
 }