gd: better bonus jump calculation
This commit is contained in:
@ -40,6 +40,7 @@
|
|||||||
[node name="Player" type="CharacterBody3D"]
|
[node name="Player" type="CharacterBody3D"]
|
||||||
script = ExtResource("1_poq2x")
|
script = ExtResource("1_poq2x")
|
||||||
TimeScaleAimInAir = 0.15
|
TimeScaleAimInAir = 0.15
|
||||||
|
MaxJumpBoostAfterDashing = 1.4
|
||||||
|
|
||||||
[node name="InputController" type="Node3D" parent="."]
|
[node name="InputController" type="Node3D" parent="."]
|
||||||
script = ExtResource("16_v31n3")
|
script = ExtResource("16_v31n3")
|
||||||
@ -172,6 +173,7 @@ offset_left = 1530.0
|
|||||||
offset_top = 1.0
|
offset_top = 1.0
|
||||||
offset_right = -2.0
|
offset_right = -2.0
|
||||||
offset_bottom = 1.0
|
offset_bottom = 1.0
|
||||||
|
enabled = false
|
||||||
initial_node_to_watch = NodePath("../StateChart")
|
initial_node_to_watch = NodePath("../StateChart")
|
||||||
|
|
||||||
[node name="StateChart" type="Node" parent="."]
|
[node name="StateChart" type="Node" parent="."]
|
||||||
|
@ -289,7 +289,9 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
var effectiveJumpDirection = jumpDirection ?? Vector3.Up;
|
var effectiveJumpDirection = jumpDirection ?? Vector3.Up;
|
||||||
var jumpVector = (effectiveJumpDirection.Normalized() + Vector3.Up).Normalized();
|
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();
|
_timeAfterDashingTimer.Stop();
|
||||||
|
|
||||||
bool doesCapsuleHaveCrouchingHeight = CapsuleCollider.IsCrouchingHeight();
|
bool doesCapsuleHaveCrouchingHeight = CapsuleCollider.IsCrouchingHeight();
|
||||||
|
Reference in New Issue
Block a user