[gd_scene load_steps=11 format=3 uid="uid://dhd0gp2xvl53l"]

[ext_resource type="Script" uid="uid://bafdl3y53ly60" path="res://Scripts/Classes/UI/PackAnimatedSprite2D.gd" id="2_724cb"]
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_wnlnm"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_ke2o5"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/LuckyStar.json" id="4_4cwfa"]
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_724cb"]

[sub_resource type="GDScript" id="GDScript_y0edb"]
script/source = "extends PowerUpItem

func on_area_entered(area: Area2D) -> void:
	if area.owner is Player:
		AudioManager.play_global_sfx(\"lucky_star\")
		$ScoreNoteSpawner.spawn_note(1000)
		DiscoLevel.combo_amount += 1
		get_tree().call_group(\"Enemies\", \"flag_die\")
		queue_free()
"

[sub_resource type="AtlasTexture" id="AtlasTexture_ke2o5"]
atlas = ExtResource("2_wnlnm")
region = Rect2(0, 64, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_4cwfa"]
atlas = ExtResource("2_wnlnm")
region = Rect2(16, 64, 16, 16)

[sub_resource type="SpriteFrames" id="SpriteFrames_48p8s"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ke2o5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4cwfa")
}],
"loop": true,
"name": &"default",
"speed": 15.0
}]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_7yv5x"]
size = Vector2(8, 8)

[node name="LuckyStar" type="CharacterBody2D"]
script = SubResource("GDScript_y0edb")
metadata/_custom_type_script = "uid://cjkurwybsaywm"

[node name="Sprite" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -8)
sprite_frames = SubResource("SpriteFrames_48p8s")
autoplay = "default"
frame_progress = 0.8284554
script = ExtResource("2_724cb")
metadata/_custom_type_script = "uid://bafdl3y53ly60"

[node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("3_ke2o5")
node_to_affect = NodePath("..")
property_name = "sprite_frames"
resource_json = ExtResource("4_4cwfa")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="Hitbox" type="Area2D" parent="."]
position = Vector2(0, -8)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_7yv5x")

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

[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
