]> Untitled Git - frog-ninja.git/blobdiff - player/fall_to_roll.gd
Separated the Visual from the Model
[frog-ninja.git] / player / fall_to_roll.gd
index 2fa1a14fdcbe5fde0f28be23f1dd7af223b6a9fb..090c84006ea9f14908cf839a04d8464ff3c2fd49 100644 (file)
@@ -3,29 +3,18 @@ class_name FallToRoll
 
 
 var finished := false
 
 
 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]
 
 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)
+       return state_name
 
 
 func on_enter_state():
        finished = false
 
 
 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
 
 
 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)