class_name Level
extends Node2D


# Declare member variables here. Examples:
# var a = 2
# var b = "text"

export var music_track :AudioStream
## if no music_track specified, LevelInfo will keep
## the last running track playing
export var keep_last_music_track: bool = false

onready var player_start = $PlayerStart
var entrances:Dictionary

# Called when the node enters the scene tree for the first time.
func _ready():
	LevelInfo.player_start_position = player_start.transform.origin
	if music_track:
		LevelInfo.change_music_track(music_track)
	elif keep_last_music_track == false:
		LevelInfo.stop_music()

	for ent in get_children():
		if ent is Position2D:
			entrances[ent.name] = ent

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