public void Enter(PlayerController p)
        {
            p.SetPhysicsProfile(p.PhysJumpGetup);
            p.Jump(p.Surface.SurfaceNormal, p.JumpForce);

            p.SpriteManager.SetAnimation("Jump");
        }
        public void Enter(PlayerController p)
        {
            startTime = Time.time;
            p.SpriteManager.SetAnimation(Animation);
            duration = p.SpriteManager.GetAnimationLength(Animation);

            p.SetPhysicsProfile(p.PhysGrounded);
        }
예제 #3
0
        public void Enter(PlayerController p)
        {
            p.SpriteManager.SetAnimation(wallJump ? WallJumpAnim : JumpAnim);

            startTime = Time.time;
            p.SetPhysicsProfile(p.PhysJumpStandard);

            // Jump, using passed values if extant.
            var d = direction ?? p.Surface.SurfaceNormal;
            var f = force ?? p.JumpForce;

            p.Jump(d, f);
        }
        public IState Execute(PlayerController p)
        {
            p.Move();
            p.ApplyGravity();

            if (p.Falling)
            {
                p.SetPhysicsProfile(p.PhysJumpGetup);
                return(new FallState());
            }

            // Only re-slide if moving down, otherwise we
            // risk regrounding immediately after jumping.
            if (p.Surface.Unstable && p.Velocity.y < 0)
            {
                return(new FallSlideState());
            }

            return(null);
        }
예제 #5
0
 public void Enter(PlayerController p)
 {
     p.SetPhysicsProfile(p.PhysGrounded);
 }