jump ani fixing and transition animations

This commit is contained in:
Nicholas Butzke
2026-08-10 12:50:00 -04:00
parent 833e936bcd
commit 0ce626ad42
13 changed files with 359 additions and 35 deletions
+20
View File
@@ -41,6 +41,7 @@ func run_all() -> void:
"test_dash_adds_speed_to_forward_momentum",
"test_chain_bonus_soft_caps",
"test_notify_landed_emits_scaled_event",
"test_ground_release_has_short_stopping_glide",
"test_slide_entry_boosts_and_keeps_direction",
"test_grapple_state_registered_by_machine",
]
@@ -239,6 +240,25 @@ func test_notify_landed_emits_scaled_event() -> void:
_expect(sm.current_jump_count == 0, "landing resets jump count")
func test_ground_release_has_short_stopping_glide() -> void:
var ground = sm.states["ground"]
var velocity := Vector3(0.0, 0.0, -params.walk_speed)
var distance := 0.0
var first_frame_speed := 0.0
for frame in 90:
velocity = ground._next_horizontal_velocity(
velocity, Vector3.ZERO, false, 1.0 / 60.0)
if frame == 0:
first_frame_speed = velocity.length()
distance += velocity.length() / 60.0
if velocity.length() <= 0.6:
break
_expect(first_frame_speed > params.walk_speed * 0.80,
"release keeps most momentum on its first frame")
_expect(distance > 0.75 and distance < 1.5,
"release produces a short stopping glide (%.2f m)" % distance)
func test_slide_entry_boosts_and_keeps_direction() -> void:
sm.switch_to("ground")
fake_player.velocity = Vector3(0, 0, -12) # faster than 0.8*walk_speed