Randoloot/scripts/game/extension_pulse.gd
2026-10-16 22:04:36 +02:00

24 lines
678 B
GDScript

extends Node2D
var color := Color("9be7ff")
var radius := 50.0
var _time := 0.0
func _ready() -> void:
z_index = 28
func _process(delta: float) -> void:
_time += delta
queue_redraw()
if _time >= 0.7:
queue_free()
func _draw() -> void:
var progress := _time / 0.7
var alpha := 1.0 - progress
for ring in 3:
draw_arc(Vector2.ZERO, 8.0 + radius * progress + float(ring) * 5.0, 0, TAU, 64, Color(color, alpha * (0.5 - float(ring) * 0.12)), 2.0, true)
for index in 12:
var direction := Vector2.RIGHT.rotated(float(index) * TAU / 12.0)
draw_line(direction * (10.0 + radius * progress), direction * (20.0 + radius * progress), Color(color, alpha * 0.6), 1.5, true)