diff --git a/lib/classes/animated_sprite_state_receiver.gd b/lib/classes/animated_sprite_state_receiver.gd index e243462..c55057a 100644 --- a/lib/classes/animated_sprite_state_receiver.gd +++ b/lib/classes/animated_sprite_state_receiver.gd @@ -1,6 +1,8 @@ class_name AnimatedSprite_StateReceiver extends AnimatedSprite +export var debug_component: bool = false + export var callable_state_machine :NodePath onready var current_state = StateAnimatedActor.new() @@ -55,6 +57,8 @@ func _process(delta): call('_state_process_' + current_state.name) func _on_animation_finished(): + if debug_component: + var foo = 2+2 if frames.get_animation_loop(animation) == false: #print("Stop!!!!!", current_state.animation_sequence.size(), " - ", current_state.animation_index) if current_state.animation_sequence.size() > 0: @@ -63,6 +67,8 @@ func _on_animation_finished(): if animation_index >= current_state.animation_sequence.size(): #print("Stop!!!!!") current_state.animation_finished = true + else: + change_animation(0,animation_index) ##TODO: Allow a way to stop animation even if in a looped sequence # If called, this will attempt to make the most appropriate animation change diff --git a/src/actors/npcs/WarriorGirl/WarriorGirl.tscn b/src/actors/npcs/WarriorGirl/WarriorGirl.tscn index 68556b3..bf2bd1e 100644 --- a/src/actors/npcs/WarriorGirl/WarriorGirl.tscn +++ b/src/actors/npcs/WarriorGirl/WarriorGirl.tscn @@ -27,6 +27,7 @@ states = [ ExtResource( 3 ), ExtResource( 6 ) ] [node name="AnimatedSprite_StateReceiver" parent="." index="1"] frames = ExtResource( 2 ) playing = true +debug_component = true [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="4"] position = Vector2( -5, 6 )