netmasked/scripts/stars.gd

18 lines
536 B
GDScript

extends MaskAbility
@export var star_scene : PackedScene
@export var count = 3
func mask_ready():
var children := get_children()
for c in children:
var star : MaskProjectile = star_scene.instantiate()
star.position = c.global_position
star.from_player = from_player
star.target_position = target_position
if not from_player:
star.modulate = Color.BLACK
get_tree().current_scene.add_child(star)
star.mask_ready()
await get_tree().create_timer(0.05).timeout
get_tree().create_timer(20).timeout.connect(queue_free)