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); }
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); }
public void Enter(PlayerController p) { p.SetPhysicsProfile(p.PhysGrounded); }