spacegame/effects/flash.gd
2025-03-22 13:32:53 +01:00

16 lines
261 B
GDScript

extends Node2D
class_name Flash
@export var oneshot : bool = true
func _ready() -> void:
if oneshot:
flash()
func flash() -> void:
if oneshot or not $animation.is_playing():
$animation.play("flash")
func destroy() -> void:
if oneshot:
queue_free()