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

[ext_resource type="Texture2D" uid="uid://devt2xbk78rej" path="res://assets/sprites/shadow.png" id="1_fvc8g"]
[ext_resource type="Script" uid="uid://cwf3afjy6t6rg" path="res://scenes/unit/unit.gd" id="1_vh40f"]
[ext_resource type="PackedScene" uid="uid://bkyyic3okyjxx" path="res://scenes/components/hurtbox_component.tscn" id="3_vh40f"]
[ext_resource type="PackedScene" uid="uid://2ew7i6g3p0v8" path="res://scenes/components/health_component.tscn" id="4_bhlit"]
[ext_resource type="PackedScene" uid="uid://ifmw1e7gycc8" path="res://scenes/ui/health_bar/health_bar.tscn" id="5_vgvef"]

[sub_resource type="Animation" id="Animation_bhlit"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Visuals/Sprite: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("Visuals/Sprite:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Visuals/Sprite:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, -61)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Visuals/Shadow:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.8, 1)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Visuals/Shadow:position")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}

[sub_resource type="Animation" id="Animation_0wuuu"]
resource_name = "move"
length = 0.5
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Visuals/Sprite:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, -61), Vector2(0, -100), Vector2(0, -61)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Visuals/Sprite:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.15, 0.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [0.0, 0.0, 1.5707963267948966]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Visuals/Sprite:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.15),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(0.8, 1.4), Vector2(0.9, 1)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Visuals/Shadow:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.1, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0.8, 1), Vector2(0.6, 1), Vector2(0.9, 1)]
}

[sub_resource type="Animation" id="Animation_vgvef"]
resource_name = "die"
length = 0.8
loop_mode = 1
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Visuals/Sprite:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.20000845, 0.4000169, 0.60002536),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(1.2, 0.8), Vector2(1, 1), Vector2(1.2, 0.8)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Visuals/Sprite:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Visuals/Shadow:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, -4)]
}

[sub_resource type="Animation" id="Animation_3po7s"]
resource_name = "idle"
length = 0.6
loop_mode = 1
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Visuals/Sprite:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(0.8, 1.1), Vector2(1, 1), Vector2(0.8, 1.1), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Visuals/Sprite:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.2617993877991494, 0.0, -0.2617993877991494, 0.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Visuals/Sprite:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(0, -61), Vector2(0, -75), Vector2(0, -61), Vector2(0, -75)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Visuals/Shadow:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.15, 0.3, 0.45),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(0.8, 1), Vector2(0.6, 1), Vector2(0.8, 1), Vector2(0.6, 1)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_w7udy"]
_data = {
&"RESET": SubResource("Animation_bhlit"),
&"die": SubResource("Animation_0wuuu"),
&"idle": SubResource("Animation_vgvef"),
&"move": SubResource("Animation_3po7s")
}

[node name="Unit" type="Area2D" unique_id=2092979720]
script = ExtResource("1_vh40f")

[node name="Visuals" type="Node2D" parent="." unique_id=395976388]
unique_name_in_owner = true
scale = Vector2(0.5, 0.5)

[node name="Shadow" type="Sprite2D" parent="Visuals" unique_id=2136480859]
modulate = Color(0.11119685, 0.11119684, 0.11119684, 1)
self_modulate = Color(0.101960786, 0.101960786, 0.101960786, 0.3372549)
scale = Vector2(0.8, 1)
texture = ExtResource("1_fvc8g")

[node name="Sprite" type="Sprite2D" parent="Visuals" unique_id=1925870318]
unique_name_in_owner = true
position = Vector2(0, -61)

[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=139786467]

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

[node name="HurtboxComponent" parent="." unique_id=1155790880 instance=ExtResource("3_vh40f")]

[node name="HealthComponent" parent="." unique_id=455886217 instance=ExtResource("4_bhlit")]

[node name="HealthBar" parent="." unique_id=1540037291 instance=ExtResource("5_vgvef")]
offset_left = -46.0
offset_top = -90.0
offset_right = 50.0
offset_bottom = -70.0

[node name="FlashTimer" type="Timer" parent="." unique_id=2034069027]
wait_time = 0.2
one_shot = true

[connection signal="on_damaged" from="HurtboxComponent" to="." method="_on_hurtbox_component_on_damaged"]
[connection signal="on_health_changed" from="HealthComponent" to="HealthBar" method="_on_health_component_on_health_changed"]
[connection signal="timeout" from="FlashTimer" to="." method="_on_flash_timer_timeout"]
