[gd_scene load_steps=7 format=2]

[ext_resource path="res://assets/Tiles/spikes-sheet.png" type="Texture" id=1]
[ext_resource path="res://src/Hazards/SpikeTrap.gd" type="Script" id=2]



[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 5, 8 )

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 10, 8 )

[sub_resource type="Animation" id=3]
resource_name = "emit"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3, 4, 5 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("DamageArea/CollisionShape2D:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector2( -11, -8 ), Vector2( -9, -8 ), Vector2( -3, -8 ), Vector2( 5, -8 ), Vector2( 5, -8 ) ]
}

[sub_resource type="Animation" id=4]
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("DamageArea/CollisionShape2D:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( -11, -8 ) ]
}

[node name="SpikeTrap" type="Node2D"]
rotation = 0.0174533
script = ExtResource( 2 )

[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -8 )
texture = ExtResource( 1 )
hframes = 6

[node name="DamageArea" type="Area2D" parent="."]
visible = false
collision_layer = 4

[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageArea"]
position = Vector2( -11, -8 )
shape = SubResource( 1 )

[node name="TriggerArea" type="Area2D" parent="."]
visible = false
collision_layer = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="TriggerArea"]
position = Vector2( 4, -8 )
shape = SubResource( 2 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.5
anims/emit = SubResource( 3 )
anims/idle = SubResource( 4 )

[node name="CoolDownTimer" type="Timer" parent="."]
one_shot = true
[connection signal="body_entered" from="DamageArea" to="." method="_on_DamageArea_body_entered"]
[connection signal="body_entered" from="TriggerArea" to="." method="_on_TriggerArea_body_entered"]
[connection signal="timeout" from="CoolDownTimer" to="." method="_on_CoolDownTimer_timeout"]
