From 288cd288e4073351e3ff53859c96dd150660f074 Mon Sep 17 00:00:00 2001 From: CactiChameleon9 Date: Tue, 26 Jul 2022 08:09:19 +0100 Subject: [PATCH] Run input dice disappear animation --- UI/CardView.gd | 6 ++++++ UI/InputDiceView.gd | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/UI/CardView.gd b/UI/CardView.gd index 82f9cd2..3fb2500 100644 --- a/UI/CardView.gd +++ b/UI/CardView.gd @@ -18,6 +18,7 @@ var card : Card = Card.new() setget update_cardview func _ready(): update_cardview() connect_signals() + card_view_run() func update_cardview(new_card = null): @@ -71,6 +72,11 @@ func add_input_dice_view(): # this is run once the card emits card_removed 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 $AnimationPlayer.play("Fly Off") yield($AnimationPlayer, "animation_finished") diff --git a/UI/InputDiceView.gd b/UI/InputDiceView.gd index 1d63b75..faac5c8 100644 --- a/UI/InputDiceView.gd +++ b/UI/InputDiceView.gd @@ -23,3 +23,8 @@ func set_bold(is_bold : bool = true): $Sprite.texture = load("res://Assets/DiceInput.png") bold = is_bold + + +func run_disappear_animation(): + $AnimationPlayer.play("Disappear") + yield($AnimationPlayer, "animation_finished")