gd: better bonus jump calculation

This commit is contained in:
2025-06-10 20:28:09 +02:00
parent cb4c16a3ca
commit 1d67c4d20a
2 changed files with 5 additions and 1 deletions

View File

@ -40,6 +40,7 @@
[node name="Player" type="CharacterBody3D"]
script = ExtResource("1_poq2x")
TimeScaleAimInAir = 0.15
MaxJumpBoostAfterDashing = 1.4
[node name="InputController" type="Node3D" parent="."]
script = ExtResource("16_v31n3")
@ -172,6 +173,7 @@ offset_left = 1530.0
offset_top = 1.0
offset_right = -2.0
offset_bottom = 1.0
enabled = false
initial_node_to_watch = NodePath("../StateChart")
[node name="StateChart" type="Node" parent="."]

View File

@ -289,7 +289,9 @@ public partial class PlayerController : CharacterBody3D
var effectiveJumpDirection = jumpDirection ?? Vector3.Up;
var jumpVector = (effectiveJumpDirection.Normalized() + Vector3.Up).Normalized();
var actualBoost = 1 + MaxJumpBoostAfterDashing * _timeAfterDashingTimer.TimeLeft;
var proportionOfTimeGone = _timeAfterDashingTimer.TimeLeft / _timeAfterDashingTimer.WaitTime;
GD.Print(proportionOfTimeGone);
var actualBoost = 1 + MaxJumpBoostAfterDashing * proportionOfTimeGone;
_timeAfterDashingTimer.Stop();
bool doesCapsuleHaveCrouchingHeight = CapsuleCollider.IsCrouchingHeight();