extends Node2D
@onready var M1:TileMapLayer = $"Node/Porte 1" 
@onready var M2:TileMapLayer = $"Node/Porte 2" 
@onready var M3:TileMapLayer = $"Node/Porte 3" 
@onready var M4:TileMapLayer = $"Node/Porte 4" 

var opened = [1,2]
var doors
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	doors = {
		1:M1,
		2:M2,
		3:M3,
		4:M4
	}   


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	for elt in opened:
		doors[elt].enabled = false

func _on_P1_entered(body: Node2D) -> void:
	if body.is_in_group("player"):
		$CanvasLayer/AnimationPlayer.play("fade")
