[gd_scene load_steps=10 format=3 uid="uid://dn2rawqxpuywe"]

[ext_resource type="Script" uid="uid://bb01xttxcem1c" path="res://Scripts/Classes/Entities/Items/Hachisuke.gd" id="1_d7uck"]
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_wdqsg"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_3unjp"]
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="3_eh4yc"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="4_3unjp"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/Hachisuke.json" id="4_db2kr"]

[sub_resource type="AtlasTexture" id="AtlasTexture_qj4fn"]
atlas = ExtResource("2_wdqsg")
region = Rect2(0, 0, 16, 16)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_kn7db"]
size = Vector2(12, 12)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_6c253"]
size = Vector2(16, 16)

[node name="Hachisuke" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 6
script = ExtResource("1_d7uck")
metadata/_custom_type_script = "uid://cjkurwybsaywm"

[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(0, -8)
texture = SubResource("AtlasTexture_qj4fn")

[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("3_3unjp")
node_to_affect = NodePath("..")
property_name = "texture"
mode = 1
resource_json = ExtResource("4_db2kr")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="ScoreNoteSpawner" type="Node" parent="."]
script = ExtResource("3_eh4yc")
add_score = true
metadata/_custom_type_script = "uid://5octqlf4ohel"

[node name="PlayerDetection" type="Area2D" parent="."]
position = Vector2(0, -8)
script = ExtResource("4_3unjp")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"

[node name="Shape" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("RectangleShape2D_kn7db")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -8)
shape = SubResource("RectangleShape2D_6c253")

[connection signal="player_entered" from="PlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [8000]]
[connection signal="player_entered" from="PlayerDetection" to="." method="play_sfx" unbinds=1]
[connection signal="player_entered" from="PlayerDetection" to="." method="queue_free" unbinds=1]
