yes, they canjj st!

This commit is contained in:
Haze Weathers 2025-12-14 17:06:42 -06:00
parent 6b92473eeb
commit a6421235f8
22 changed files with 510 additions and 14 deletions

View file

@ -0,0 +1,31 @@
class_name BulletSet
extends Node2D
@export var preset: BulletPreset
func _ready() -> void:
for _n in preset.rounds:
preset.pattern.spawn_bullets(self, preset)
await get_tree().create_timer(preset.round_delay, false, true).timeout
func _physics_process(delta: float) -> void:
for bullet in get_children():
if bullet is Bullet:
preset.behavior.process_bullet(bullet, delta)
else:
push_error("BulletSet does not support having non-bullet children. Removing child: ", bullet)
bullet.queue_free()
func add_bullet(bullet: Bullet) -> void:
preset.behavior.init_bullet(bullet)
add_child(bullet)
func add_bullets(new_bullets: Array[Bullet]) -> void:
for bullet in new_bullets:
preset.behavior.init_bullet(bullet)
add_child(bullet)