18 lines
323 B
GDScript
18 lines
323 B
GDScript
extends Light2D
|
|
|
|
|
|
export var lifetime: float = 5.0
|
|
|
|
|
|
func _ready() -> void:
|
|
rotation = randf() * TAU
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
lifetime -= delta
|
|
if lifetime < 1.0:
|
|
global_position.y += 4.0 * delta
|
|
if lifetime < 0.5:
|
|
scale = Vector2(lifetime * 2.0, lifetime * 2.0)
|
|
if lifetime <= 0.0:
|
|
queue_free()
|