22 lines
731 B
GDScript3
22 lines
731 B
GDScript3
|
|
class_name ExplosionParticle
|
||
|
|
extends Node2D
|
||
|
|
|
||
|
|
# One debris chunk / energy streak inside an explosion. Draws its fixed
|
||
|
|
# local-space shape exactly once (like Ship.gd/Asteroid.gd draw once and
|
||
|
|
# animate via node properties), then ExplosionVFXBase drives it every frame
|
||
|
|
# purely through `position` and `rotation` - no further redraw needed.
|
||
|
|
#
|
||
|
|
# The shape itself is supplied by the owning VFX class via a Callable rather
|
||
|
|
# than being known here, since different explosion styles (glowing streak
|
||
|
|
# vs. rock-chunk polygon) draw completely differently; this class only owns
|
||
|
|
# the "draw once, then just move" mechanics.
|
||
|
|
|
||
|
|
var draw_callable: Callable
|
||
|
|
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
queue_redraw()
|
||
|
|
|
||
|
|
|
||
|
|
func _draw() -> void:
|
||
|
|
draw_callable.call(self)
|