main menu: fix animations start times

This commit is contained in:
Alice Gaudon 2020-08-17 11:38:42 +02:00
parent 79e7954b50
commit 47944509f7
2 changed files with 11 additions and 5 deletions

View File

@ -13,17 +13,21 @@
[node name="Node2D" type="Node2D"]
[node name="background" type="AnimatedSprite" parent="."]
[node name="ely" type="AnimatedSprite" parent="."]
visible = false
frames = ExtResource( 4 )
animation = "start"
centered = false
script = ExtResource( 1 )
start_delay = 2.0
[node name="Fire" type="AnimatedSprite" parent="."]
[node name="fire" type="AnimatedSprite" parent="."]
visible = false
frames = ExtResource( 6 )
animation = "start"
centered = false
script = ExtResource( 1 )
start_delay = 4.0
[node name="UI" type="Control" parent="."]
margin_right = 40.0
@ -80,5 +84,5 @@ script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="animation_finished" from="background" to="background" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="Fire" to="Fire" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"]

View File

@ -1,10 +1,12 @@
extends AnimatedSprite
export var start_delay : float = 0.1
func _ready():
yield(get_tree().create_timer(0.1), 'timeout')
yield(get_tree().create_timer(start_delay), 'timeout')
play('start')
frame = 0
show()
func _on_background_animation_finished():
play('idle')