LD54_Box_Survival/circleParticle.gd
Stephen Seo 7cb180c245 Work
Impl. enough for basic gameplay and has some particle effects.
2023-09-30 15:38:24 +09:00

21 lines
437 B
GDScript

extends RigidBody2D
const LIFETIME = 5
var timer = 0.0
@onready var sprite = $Sprite2D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
timer += delta
if timer >= LIFETIME:
get_parent().remove_child(self)
else:
sprite.self_modulate.a = 1.0 - timer / LIFETIME