From f998f37693e4917d7e63a34fc3677ca621839078 Mon Sep 17 00:00:00 2001 From: Artur David Date: Sat, 6 Jun 2026 02:08:32 +0200 Subject: [PATCH] spawn enemies into World node for y_sort --- scripts/spawn_control.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/spawn_control.gd b/scripts/spawn_control.gd index 5101aa3..d74d560 100644 --- a/scripts/spawn_control.gd +++ b/scripts/spawn_control.gd @@ -86,7 +86,7 @@ func _active_stage_idx() -> int: func _spawn_elite(scene: PackedScene) -> void: var enemy = scene.instantiate() enemy.global_position = get_spawn_position() - add_child(enemy) + get_node("/root/Game/World").add_child(enemy) enemy.scale = Vector2(ELITE_SCALE, ELITE_SCALE) enemy.max_hp = enemy.max_hp * ELITE_HP_MULT enemy.hp = enemy.max_hp @@ -140,4 +140,4 @@ func _spawn_one(entry: StageEntry, state: Dictionary) -> void: state["alive"] += 1 state["spawned_total"] += 1 enemy.tree_exited.connect(func(): state["alive"] -= 1) - add_child(enemy) + get_node("/root/Game/World").add_child(enemy)