]> Untitled Git - frog-ninja.git/blobdiff - player/moves/shoot.gd
Separated the Visual from the Model
[frog-ninja.git] / player / moves / shoot.gd
index ab317fa0b22c4bf6fad82f6ac2ac9c7915105741..c97cb2cfd5e4e8b58c1b813b74bf4e7062f7e524 100644 (file)
@@ -3,29 +3,19 @@ class_name Shoot
 
 
 var finished := false
-const shoot_walk_speed := 4.0
 
 
 func should_enter(input: InputPacket) -> String:
        if finished:
                input.actions.sort_custom(moves_priority_sort)
                return input.actions[0]
-       return "shoot"
-
-
-func update(input: InputPacket, delta: float):
-       player.velocity = get_new_velocity_from_input(input, delta, shoot_walk_speed)
-       player.move_and_slide()
-       update_skin(delta)
+       return state_name
 
 
 func on_enter_state():
        finished = false
-       player.skin.animation_tree.animation_finished.connect(_on_animation_finished)
-       player.skin.transition_gunfire()
 
 
 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)