[gd_scene load_steps=24 format=3 uid="uid://dnx48rakxib6u"]

[ext_resource type="Script" uid="uid://dv18do583a3x0" path="res://Scripts/Classes/Entities/Enemies/Goomba.gd" id="1_4f3if"]
[ext_resource type="Texture2D" uid="uid://bvgp1xgj7cauc" path="res://Assets/Sprites/Enemies/Goomba.png" id="1_rvg4p"]
[ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="2_4f3if"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_75r84"]
[ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="4_7ob4c"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="5_75r84"]
[ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="5_ncruo"]
[ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Goomba.json" id="6_magh7"]
[ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="6_yt1if"]
[ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="7_d04bf"]
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="8_e62ic"]
[ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="11_067r1"]
[ext_resource type="Script" uid="uid://blfnd65xcx78c" path="res://Scripts/Classes/Components/LedgeDetectionCast.gd" id="13_dpode"]
[ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="13_magh7"]
[ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="14_3aros"]
[ext_resource type="Script" uid="uid://d0mqkvopasu8k" path="res://Scripts/Classes/Components/SecondQuestReplaceComponent.gd" id="15_dpode"]
[ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="17_6o7qg"]
[ext_resource type="Script" uid="uid://maqpreddu5kg" path="res://Scripts/Classes/Components/LevelPersistance.gd" id="18_hkf3f"]

[sub_resource type="AtlasTexture" id="AtlasTexture_magh7"]
atlas = ExtResource("1_rvg4p")
region = Rect2(32, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_hkf3f"]
atlas = ExtResource("1_rvg4p")
region = Rect2(0, 0, 16, 16)

[sub_resource type="SpriteFrames" id="SpriteFrames_u44np"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_magh7")
}],
"loop": true,
"name": &"Stomped",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hkf3f")
}],
"loop": true,
"name": &"Walk",
"speed": 5.0
}]

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

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qm5my"]
size = Vector2(14, 15)

[node name="Goomba" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
collision_layer = 16
collision_mask = 50
floor_constant_speed = true
floor_max_angle = 1.3613569
script = ExtResource("1_4f3if")
on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
score_note_adder = NodePath("ScoreNoteSpawner")

[node name="Sprite" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -8)
scale = Vector2(-1, 1)
sprite_frames = SubResource("SpriteFrames_u44np")
animation = &"Walk"
autoplay = "Walk"
frame_progress = 0.274184
offset = Vector2(0, 1)
flip_h = true
script = ExtResource("3_75r84")
metadata/_custom_type_script = "uid://caq1qiwmy0mox"

[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect", "property_node")]
script = ExtResource("5_75r84")
node_to_affect = NodePath("..")
property_node = NodePath("../..")
property_name = "sprite_frames"
resource_json = ExtResource("6_magh7")

[node name="LCollision" type="CollisionShape2D" parent="."]
position = Vector2(0, -6)
rotation = 1.5708
shape = SubResource("RectangleShape2D_e62ic")
one_way_collision = true

[node name="RCollision" type="CollisionShape2D" parent="."]
position = Vector2(0, -6)
rotation = -1.5708
shape = SubResource("RectangleShape2D_e62ic")
one_way_collision = true

[node name="Hitbox" type="Area2D" parent="."]
collision_mask = 7

[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, -6.5)
shape = SubResource("RectangleShape2D_qm5my")

[node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("2_4f3if")
hitbox = NodePath("../Hitbox")

[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
self_modulate = Color(1, 1, 1, 0)
position = Vector2(0, -8)

[node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
script = ExtResource("4_7ob4c")
visuals = NodePath("../Sprite")

[node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("5_ncruo")
detection_type = 1
hitbox = NodePath("../Hitbox")

[node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("6_yt1if")
hitbox = NodePath("../Hitbox")

[node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("7_d04bf")
hitbox = NodePath("../Hitbox")
metadata/_custom_type_script = "uid://bbww34oiexbx2"

[node name="ScoreNoteSpawner" type="Node" parent="."]
script = ExtResource("8_e62ic")
add_score = true

[node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("11_067r1")
hitbox = NodePath("../Hitbox")
metadata/_custom_type_script = "uid://dq860i312isk"

[node name="Node2D" type="Node2D" parent="."]

[node name="LedgeDetectionCast" type="RayCast2D" parent="."]
position = Vector2(-2, -2)
target_position = Vector2(0, 3)
collision_mask = 2
script = ExtResource("13_dpode")

[node name="BasicEnemyMovement" type="Node" parent="."]
script = ExtResource("13_magh7")

[node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("14_3aros")
hitbox = NodePath("../Hitbox")

[node name="SecondQuestReplacer" type="Node" parent="."]
script = ExtResource("15_dpode")
new_scene = "uid://doo8617qiyp77"
metadata/_custom_type_script = "uid://d0mqkvopasu8k"

[node name="TrackJoint" type="Node" parent="." node_paths=PackedStringArray("movement_node")]
script = ExtResource("17_6o7qg")
movement_node = NodePath("../BasicEnemyMovement")

[node name="LevelPersistance" type="Node" parent="."]
script = ExtResource("18_hkf3f")
metadata/_custom_type_script = "uid://maqpreddu5kg"

[connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
[connection signal="killed" from="." to="LevelPersistance" method="set_as_active" unbinds=1]
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
[connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
[connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="stomped_on"]
[connection signal="player_stomped_on" from="EnemyPlayerDetection" to="LevelPersistance" method="set_as_active" unbinds=1]
[connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
[connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
[connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
[connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
[connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
[connection signal="icicle_detected" from="IcicleDetection" to="." method="die_from_object" flags=3]
[connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
[connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
[connection signal="enabled" from="LevelPersistance" to="." method="queue_free"]
