[gd_scene load_steps=9 format=3 uid="uid://b4uqa4y5o63xy"]

[ext_resource type="PackedScene" uid="uid://bxvcax2wc48xh" path="res://Scenes/Prefabs/Blocks/NoteBlock.tscn" id="1_2p7lf"]
[ext_resource type="Script" uid="uid://2gxl5hj6mf6a" path="res://Scripts/Classes/Blocks/MusicNoteBlock.gd" id="2_1gaxc"]
[ext_resource type="JSON" path="res://Assets/Sprites/Blocks/MusicNoteBlock.json" id="3_d6amy"]
[ext_resource type="Script" uid="uid://cpwloakvp672a" path="res://Scripts/Parts/EditorVisibleNode.gd" id="3_lw6l2"]
[ext_resource type="Texture2D" uid="uid://b8su0m8876337" path="res://Assets/Sprites/Editor/NoteBlockNotes.png" id="4_d6amy"]
[ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="6_gpide"]

[sub_resource type="AudioStreamGenerator" id="AudioStreamGenerator_1gaxc"]

[sub_resource type="GDScript" id="GDScript_lw6l2"]
script/source = "extends Node

func _process(_delta: float) -> void:
	%Note.frame = owner.note
	%Octave.frame = owner.octave + 11
"

[node name="NoteBlock" instance=ExtResource("1_2p7lf")]
script = ExtResource("2_1gaxc")
play_on_load = false
instrument = 0
note = 3
octave = 2
play_sfx = false

[node name="ResourceSetterNew" parent="Sprite" index="0"]
resource_json = ExtResource("3_d6amy")

[node name="EditorPropertyExposer" parent="." index="3"]
properties = Array[String](["instrument", "note", "octave", "play_on_load"])

[node name="Instrument" type="AudioStreamPlayer2D" parent="." index="4"]
process_mode = 3
stream = SubResource("AudioStreamGenerator_1gaxc")
volume_db = 24.0
bus = &"SFX"

[node name="LevelEditorVisibleNode" type="Node2D" parent="." index="5"]
script = ExtResource("3_lw6l2")
metadata/_custom_type_script = "uid://cpwloakvp672a"

[node name="Note" type="Sprite2D" parent="LevelEditorVisibleNode" index="0"]
unique_name_in_owner = true
position = Vector2(1, -5)
texture = ExtResource("4_d6amy")
hframes = 12
vframes = 2
frame = 1

[node name="Octave" type="Sprite2D" parent="LevelEditorVisibleNode" index="1"]
unique_name_in_owner = true
position = Vector2(6, -5)
texture = ExtResource("4_d6amy")
hframes = 12
vframes = 2
frame = 12

[node name="Node" type="Node" parent="." index="6"]
process_mode = 3
script = SubResource("GDScript_lw6l2")

[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="." index="7"]

[node name="TrackJoint" type="Node" parent="." index="8"]
script = ExtResource("6_gpide")
offset = Vector2(0, 0)
metadata/_custom_type_script = "uid://d4a7yp6e55u8t"

[connection signal="bounced" from="." to="." method="play_sfx_preview"]
[connection signal="screen_entered" from="VisibleOnScreenNotifier2D" to="." method="on_screen_entered"]
