[gd_scene load_steps=14 format=2]

[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/components/Hitbox_Component.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/Actors/Enemies/Spider/spider_movement_component.gd" type="Script" id=3]
[ext_resource path="res://src/Actors/Enemies/Spider/states/move.gd" type="Script" id=4]
[ext_resource path="res://src/Actors/Enemies/Spider/states/idle.gd" type="Script" id=5]

[sub_resource type="StreamTexture" id=1]
load_path = "res://.import/Spider1.png-85cc52177a93c8766bb76a39a26b9d70.stex"

[sub_resource type="AtlasTexture" id=2]
atlas = SubResource( 1 )
region = Rect2( 0, 26, 20, 26 )

[sub_resource type="AtlasTexture" id=3]
atlas = SubResource( 1 )
region = Rect2( 0, 0, 20, 26 )

[sub_resource type="AtlasTexture" id=4]
atlas = SubResource( 1 )
region = Rect2( 20, 0, 20, 26 )

[sub_resource type="AtlasTexture" id=5]
atlas = SubResource( 1 )
region = Rect2( 40, 0, 20, 26 )

[sub_resource type="SpriteFrames" id=6]
animations = [ {
"frames": [ SubResource( 2 ) ],
"loop": false,
"name": "die",
"speed": 10.0
}, {
"frames": [ SubResource( 3 ) ],
"loop": false,
"name": "idle",
"speed": 10.0
}, {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
"loop": false,
"name": "jump",
"speed": 10.0
}, {
"frames": [ SubResource( 5 ), SubResource( 4 ), SubResource( 3 ) ],
"loop": false,
"name": "land",
"speed": 10.0
} ]

[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 10, 12 )

[sub_resource type="CircleShape2D" id=8]

[node name="Spider" instance=ExtResource( 1 )]
actor_type = "Enemy"

[node name="AnimatedSprite" parent="." index="0"]
frames = SubResource( 6 )
animation = "jump"
frame = 2
__meta__ = {
"_aseprite_wizard_config_": {
"layer": "",
"o_ex_p": "",
"o_folder": "res://assets",
"o_name": "",
"only_visible": true,
"op_exp": false,
"slice": "",
"source": "D:/Sync/Assets/Library/Spider1.ase"
}
}

[node name="movement_component" parent="." index="1"]
script = ExtResource( 3 )

[node name="movement_state_machine" parent="." index="2"]
debug_state_machine = true

[node name="idle" parent="movement_state_machine" index="0"]
script = ExtResource( 5 )
timeout_seconds = 0.5
animation_sequence = [ "idle" ]

[node name="fall" parent="movement_state_machine" index="1"]
animation_sequence = [ "land" ]

[node name="move" parent="movement_state_machine" index="2"]
script = ExtResource( 4 )
animation_sequence = [ "jump" ]
jump_force = 200.0

[node name="CollisionShape2D" parent="Hurtbox_Component" index="0"]
position = Vector2( 0, -1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="5"]
position = Vector2( 0, -2 )
shape = SubResource( 7 )

[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="." index="6"]
position = Vector2( 0, 1 )

[node name="Hitbox_Component" parent="." index="7" instance=ExtResource( 2 )]
damage_amount = 5

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
position = Vector2( 0, -1 )
shape = SubResource( 8 )

[connection signal="screen_entered" from="VisibilityNotifier2D" to="movement_component" method="_on_VisibilityNotifier2D_screen_entered"]
