spawn enemies into World node for y_sort

main
Artur David 2026-06-06 02:08:32 +02:00
parent 9ae4bba208
commit f998f37693
1 changed files with 2 additions and 2 deletions

View File

@ -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)