X-Git-Url: http://git.purplebirdman.com/frog-ninja.git/blobdiff_plain/38bec94dddbd6aa14799d7af8e3259dbcf8f682b..refs/heads/state-machine:/player/fall_to_roll.gd diff --git a/player/fall_to_roll.gd b/player/fall_to_roll.gd deleted file mode 100644 index 2fa1a14..0000000 --- a/player/fall_to_roll.gd +++ /dev/null @@ -1,31 +0,0 @@ -extends Walk -class_name FallToRoll - - -var finished := false -const roll_speed := 5.0 - - -func should_enter(input: InputPacket) -> String: - if finished: - input.actions.sort_custom(moves_priority_sort) - return input.actions[0] - return "fallToRoll" - - -func update(input: InputPacket, delta: float): - player.velocity = get_new_velocity_from_input(input, delta, roll_speed) - player.move_and_slide() - update_skin(delta) - - -func on_enter_state(): - finished = false - player.skin.animation_tree.animation_finished.connect(_on_animation_finished) - player.skin.transition_fallToRoll() - - -func _on_animation_finished(_name: String): - # TODO: make sure animation is finished by using name - finished = true - player.skin.animation_tree.animation_finished.disconnect(_on_animation_finished)