[gd_scene load_steps=12 format=2]

[ext_resource path="res://scenes/levels/02/assets/castle.svg" type="Texture" id=1]
[ext_resource path="res://scenes/levels/02/assets/castle_door_opened_3.svg" type="Texture" id=2]
[ext_resource path="res://scenes/levels/02/assets/castle_door_closed.svg" type="Texture" id=3]
[ext_resource path="res://scenes/levels/02/assets/castle_door_opened_4.svg" type="Texture" id=4]
[ext_resource path="res://scenes/levels/02/assets/castle_door_opened_2.svg" type="Texture" id=5]
[ext_resource path="res://scenes/levels/02/assets/castle_door_opened_1.svg" type="Texture" id=6]
[ext_resource path="res://scenes/levels/02/castle.gd" type="Script" id=7]

[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 3 ), ExtResource( 6 ), ExtResource( 5 ), ExtResource( 2 ), ExtResource( 4 ) ],
"loop": false,
"name": "open",
"speed": 15.0
} ]

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 595, 385 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 17.5, 17.5 )

[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 105, 175 )

[node name="Castle" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
script = ExtResource( 7 )

[node name="Sprite" type="Sprite" parent="."]
scale = Vector2( 0.334, 0.334 )
texture = ExtResource( 1 )

[node name="DoorSprite" type="AnimatedSprite" parent="."]
position = Vector2( 175, 350 )
scale = Vector2( 0.336, 0.336 )
frames = SubResource( 1 )
animation = "open"

[node name="Collision" type="CollisionShape2D" parent="."]
position = Vector2( 0, 140 )
shape = SubResource( 2 )

[node name="Lock" type="Area2D" parent="."]
collision_layer = 0

[node name="Collision" type="CollisionShape2D" parent="Lock"]
position = Vector2( 367.5, 472.5 )
shape = SubResource( 3 )

[node name="Door" type="Area2D" parent="."]
collision_layer = 0

[node name="Collision" type="CollisionShape2D" parent="Door"]
position = Vector2( 175, 350 )
shape = SubResource( 4 )

[connection signal="body_entered" from="Lock" to="." method="_on_Unlock"]
[connection signal="body_entered" from="Door" to="." method="_on_entered_castle"]
