untitled-plant-game/World/Flower.gd

19 lines
359 B
GDScript3
Raw Normal View History

2021-12-04 20:02:52 +00:00
extends AnimatedSprite
var can_be_removed = false
func _ready() -> void:
frame = 0
play("blossom")
$Tween.interpolate_property(self, "rotation_degrees", 0, 360, 1, Tween.TRANS_BOUNCE, Tween.EASE_OUT)
$Tween.start()
func remove():
can_be_removed = true
play("remove")
func _on_Flower_animation_finished() -> void:
if can_be_removed:
queue_free()