extends Node2D ## An expanding ring that fades out, drawn where something exploded. const SECONDS := 0.3 var radius := 80.0 var _progress := 0.0: set(value): _progress = value queue_redraw() func _ready() -> void: var tween := create_tween() tween.tween_property(self, "_progress", 1.0, SECONDS).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC) tween.tween_callback(queue_free) func _draw() -> void: var color := Params.COLOR_ORANGE color.a = 1.0 - _progress draw_circle(Vector2.ZERO, radius * _progress, color, false, 6.0 * (1.0 - _progress) + 1.0, true) color.a *= 0.25 draw_circle(Vector2.ZERO, radius * _progress, color, true, -1.0, true)