spaceship/LightBurstVFX.gd

15 lines
551 B
GDScript3
Raw Normal View History

class_name LightBurstVFX
extends ExplosionVFXBase
# Shared radiating-neon-streak rendering for energy-based objects (player
# ships, enemies) - concrete subclasses only need to fix their own color.
var color: Color = Color(1, 1, 1)
func _draw_particle(p: Dictionary, alpha: float) -> void:
var vel: Vector2 = p["vel"]
var dir: Vector2 = vel.normalized() if vel.length() > 0.01 else Vector2.RIGHT
var half: Vector2 = dir * p["size"] * 0.5
var pos: Vector2 = p["pos"]
NeonDraw.draw_glowing_line(self, pos - half, pos + half, color, alpha, 0.6)