16 lines
261 B
GDScript
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()
|