Run input dice disappear animation

This commit is contained in:
CactiChameleon9 2022-07-26 08:09:19 +01:00
parent 3f2281a155
commit 288cd288e4
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@ var card : Card = Card.new() setget update_cardview
func _ready(): func _ready():
update_cardview() update_cardview()
connect_signals() connect_signals()
card_view_run()
func update_cardview(new_card = null): func update_cardview(new_card = null):
@ -71,6 +72,11 @@ func add_input_dice_view():
# this is run once the card emits card_removed # this is run once the card emits card_removed
func card_view_run(): func card_view_run():
# play the disappearing input dice animation
for i in input_dice_views:
yield(i.run_disappear_animation(), "completed")
# play the using animation # play the using animation
$AnimationPlayer.play("Fly Off") $AnimationPlayer.play("Fly Off")
yield($AnimationPlayer, "animation_finished") yield($AnimationPlayer, "animation_finished")

View File

@ -23,3 +23,8 @@ func set_bold(is_bold : bool = true):
$Sprite.texture = load("res://Assets/DiceInput.png") $Sprite.texture = load("res://Assets/DiceInput.png")
bold = is_bold bold = is_bold
func run_disappear_animation():
$AnimationPlayer.play("Disappear")
yield($AnimationPlayer, "animation_finished")