extends Node2D
class_name EncounterSpawner

@export var encounter_nodes : Array[PackedScene]
@export var spawn_positions : Array[Node2D]



# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	for position_node in spawn_positions:
		var random_encounter_index = randi_range(0,encounter_nodes.size()-1)
		var node = encounter_nodes[random_encounter_index]
		var spawned_node = node.instantiate()
		spawned_node.encounter_parent = position_node
		position_node.add_child(spawned_node)
		spawned_node.spawn_object()


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass
