[gd_scene format=3 uid="uid://b7714igdawxkl"]

[ext_resource type="Texture2D" uid="uid://8m01rykobaa6" path="res://placeholder_sprites/colored_packed.png" id="1_fon66"]
[ext_resource type="Script" uid="uid://dkebgdlyklndt" path="res://civilization/building.gd" id="1_p3b7u"]
[ext_resource type="Shader" uid="uid://r5f26ul0yfun" path="res://Sprites/Palettes/paletteSwap.gdshader" id="2_0c2ly"]
[ext_resource type="Texture2D" uid="uid://ibjjj3mostj1" path="res://Sprites/Palettes/orsage.png" id="3_xj7dy"]
[ext_resource type="Texture2D" uid="uid://bns1rrasiison" path="res://Sprites/Health/HealthBar_Under.png" id="5_lror5"]
[ext_resource type="Texture2D" uid="uid://bynjmy63s201e" path="res://Sprites/Health/HealthBar_Progress.png" id="6_07rr8"]
[ext_resource type="AudioStream" uid="uid://66ss05mma65w" path="res://Audio/Audio_Building_Destroyed.wav" id="7_07rr8"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_0c2ly"]
resource_local_to_scene = true
shader = ExtResource("2_0c2ly")
shader_parameter/palette = ExtResource("3_xj7dy")

[sub_resource type="AtlasTexture" id="AtlasTexture_p3b7u"]
atlas = ExtResource("1_fon66")
region = Rect2(176, 240, 16, 16)

[sub_resource type="Animation" id="Animation_0c2ly"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationPivot/Sprite2D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationPivot:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}

[sub_resource type="Animation" id="Animation_xj7dy"]
resource_name = "spawn"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationPivot/Sprite2D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.23333333, 0.36666667, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(1.1, 1.1), Vector2(1, 1), Vector2(1.15, 0.86), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationPivot:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.16666667, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(0, -10), Vector2(0, -10), Vector2(0, 5), Vector2(0, 0)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_lq42j"]
_data = {
&"RESET": SubResource("Animation_0c2ly"),
&"spawn": SubResource("Animation_xj7dy")
}

[sub_resource type="RectangleShape2D" id="RectangleShape2D_p3b7u"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_lror5"]
resource_local_to_scene = true
shader = ExtResource("2_0c2ly")

[node name="Building" type="Area2D" unique_id=843902316 node_paths=PackedStringArray("animation_player", "sprite_2d", "health_bar")]
collision_layer = 2
collision_mask = 2
script = ExtResource("1_p3b7u")
animation_player = NodePath("AnimationPlayer")
sprite_2d = NodePath("AnimationPivot/Sprite2D")
health_bar = NodePath("HealthBar")

[node name="AnimationPivot" type="Node2D" parent="." unique_id=1095099242]

[node name="Sprite2D" type="Sprite2D" parent="AnimationPivot" unique_id=1927129681]
y_sort_enabled = true
material = SubResource("ShaderMaterial_0c2ly")
texture = SubResource("AtlasTexture_p3b7u")

[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=497108843]
libraries/ = SubResource("AnimationLibrary_lq42j")

[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=767266246]
shape = SubResource("RectangleShape2D_p3b7u")

[node name="HealthBar" type="TextureProgressBar" parent="." unique_id=1870733583]
material = SubResource("ShaderMaterial_lror5")
offset_left = -8.0
offset_top = 16.0
offset_right = 8.0
offset_bottom = 21.0
nine_patch_stretch = true
stretch_margin_left = 2
stretch_margin_right = 2
texture_under = ExtResource("5_lror5")
texture_progress = ExtResource("6_07rr8")

[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=99938498]
stream = ExtResource("7_07rr8")
max_distance = 1000.0
attenuation = 5.0

[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="area_exited" from="." to="." method="_on_area_exited"]
