godot-plateformer/_player/states/climb_jump.gd

19 lines
444 B
GDScript3
Raw Permalink Normal View History

2025-12-29 11:54:31 +08:00
extends LimboState
func _setup() -> void:
self.add_event_handler(&"completed_jump",_handler_completed_jump)
func _enter() -> void:
agent.locomotion_comp.start_climb_jump()
func _update(delta: float) -> void:
if agent.velocity.y >= 0:
get_root().dispatch(self.EVENT_FINISHED)
func _exit() -> void:
agent.locomotion_comp.stop_climb_jump()
func _handler_completed_jump() -> bool:
get_root().dispatch(self.EVENT_FINISHED)
return true