5 const fall_landing_limit := 3.0
6 const fall_roll_limit := 6.0
11 func should_enter(input: InputPacket) -> String:
12 if not player.is_on_floor():
13 input.actions.append("fall")
14 elif not landing_type.is_empty():
15 input.actions.append(landing_type)
17 input.actions.sort_custom(moves_priority_sort)
18 return input.actions[0]
21 func update(_input: InputPacket, delta: float):
22 player.velocity += player.get_gravity() * delta
24 if abs(player.velocity.y) > fall_landing_limit:
25 if abs(player.velocity.y) > fall_roll_limit:
26 landing_type = "fallToRoll"
28 landing_type = "fallToLanding"
30 player.move_and_slide()
33 func on_enter_state():
34 player.skin.transition_fall()