19 lines
426 B
GDScript
19 lines
426 B
GDScript
class_name DanmakuEmitter
|
|
extends Node2D
|
|
|
|
|
|
@export var spawn_parent: Node2D
|
|
@export var preset: BulletPreset
|
|
|
|
|
|
func spawn_preset() -> void:
|
|
var bullet_set = BulletSet.new()
|
|
bullet_set.preset = preset
|
|
bullet_set.global_position = global_position
|
|
bullet_set.global_rotation = global_rotation
|
|
spawn_parent.add_child(bullet_set)
|
|
|
|
|
|
func clear_bullets() -> void:
|
|
for child in spawn_parent.get_children():
|
|
child.queue_free()
|