some jumping animations
This commit is contained in:
@@ -85,6 +85,7 @@ DecelerationFloor = 3.0
|
||||
AccelerationAir = 0.8
|
||||
DecelerationAir = 0.02
|
||||
Weight = 4.0
|
||||
MantleTime = 0.3
|
||||
MantlePath = ExtResource("2_6lejt")
|
||||
MantleDashStrength = 25.0
|
||||
MantleJumpStartVelocity = 15.0
|
||||
|
||||
@@ -324,6 +324,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
private Transition _onJumpFromWall;
|
||||
private Transition _onJumpFromWallFalling;
|
||||
private Transition _onLeaveWallFromRun;
|
||||
private Transition _onAirborneToGrounded;
|
||||
|
||||
private Transition _onGroundSlideJump;
|
||||
private Transition _onAirGlideDoubleJump;
|
||||
@@ -448,6 +449,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
|
||||
_onWallRunning = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Running"));
|
||||
_onLeaveWallFromRun = Transition.Of(GetNode("StateChart/Root/Movement/OnWall/Running/OnLeaveWall"));
|
||||
_onAirborneToGrounded = Transition.Of(GetNode("StateChart/Root/Movement/Airborne/OnGrounded"));
|
||||
|
||||
// State timers
|
||||
_powerCooldownTimer = GetNode<Timer>("PowerCooldown");
|
||||
@@ -551,6 +553,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_onJumpFromWall.Taken += OnJumpFromWall;
|
||||
_onJumpFromWallFalling.Taken += OnJumpFromWall;
|
||||
_onLeaveWallFromRun.Taken += OnLeaveWallFromRun;
|
||||
_onAirborneToGrounded.Taken += OnAirborneToGrounded;
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
@@ -645,6 +648,11 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
}
|
||||
|
||||
public void OnAirborneToGrounded()
|
||||
{
|
||||
HeadSystem.OnJumpEnded();
|
||||
}
|
||||
|
||||
public bool IsGroundLike()
|
||||
{
|
||||
return GroundDetector.GetCollisionResult().Count > 0;
|
||||
@@ -1155,7 +1163,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_playerState.SendEvent("mantle");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
HeadSystem.OnJumpStarted();
|
||||
if (WallHugSystem.IsWallHugging())
|
||||
{
|
||||
_playerState.SendEvent("wall_jump");
|
||||
@@ -1280,11 +1289,10 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_mantlePath.Setup(transform, curve);
|
||||
_mantleStartPosition = GlobalPosition;
|
||||
|
||||
var curveLength = curve.GetBakedLength();
|
||||
var tween = GetTree().CreateTween();
|
||||
tween.SetTrans(Tween.TransitionType.Linear);
|
||||
tween.SetEase(Tween.EaseType.In);
|
||||
tween.TweenProperty(_mantlePath.PathFollow, "progress_ratio", 1, MantleTime*curveLength);
|
||||
tween.TweenProperty(_mantlePath.PathFollow, "progress_ratio", 1, MantleTime);
|
||||
tween.Finished += MantleFinished;
|
||||
}
|
||||
public void HandleMantling(float delta)
|
||||
|
||||
Reference in New Issue
Block a user