This commit is contained in:
2026-03-14 12:58:55 -05:00
parent 6738e8d217
commit 1c95315496
22 changed files with 313 additions and 45 deletions

View File

@@ -13,6 +13,7 @@
[ext_resource type="Script" uid="uid://cd2ewadcm8oi5" path="res://Scripts/Characters/Player/States/firing_arrow_state.gd" id="8_plevq"]
[ext_resource type="Script" uid="uid://bx1a35al4yiej" path="res://Scripts/Characters/Player/States/sitting_state.gd" id="9_sdxbo"]
[ext_resource type="Script" uid="uid://bnontuqj3cnom" path="res://Scripts/Characters/Player/States/cutscene_state.gd" id="10_p06rw"]
[ext_resource type="Script" uid="uid://wfdtd3xlgrvm" path="res://Scripts/Characters/Player/States/play_animation_state.gd" id="12_aencf"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_apx8m"]
size = Vector2(10, 5)
@@ -23,9 +24,11 @@ radius = 12.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fu1fx"]
size = Vector2(6, 5)
[node name="Player" type="CharacterBody2D" unique_id=1502234578 groups=["Player Group"]]
[node name="Player" type="CharacterBody2D" unique_id=1502234578 node_paths=PackedStringArray("player_sprite", "state_machine") groups=["Player Group"]]
y_sort_enabled = true
script = ExtResource("1_qqvsf")
player_sprite = NodePath("Player Sprite")
state_machine = NodePath("State Machine")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=495465356]
position = Vector2(0, 4.5)
@@ -36,53 +39,57 @@ shape = SubResource("RectangleShape2D_apx8m")
[node name="FacingDirectionComponent" type="Node" parent="Components" unique_id=408127032]
script = ExtResource("1_siygm")
[node name="StateMachine" parent="." unique_id=732559774 node_paths=PackedStringArray("states_container", "current_state") instance=ExtResource("1_lyjr2")]
[node name="MovementComponent" type="Node" parent="Components" unique_id=1773880772 node_paths=PackedStringArray("body")]
script = ExtResource("4_apx8m")
body = NodePath("../..")
[node name="State Machine" parent="." unique_id=732559774 node_paths=PackedStringArray("states_container", "current_state") instance=ExtResource("1_lyjr2")]
states_container = NodePath("States")
current_state = NodePath("States/Idle State")
[node name="States" type="Node" parent="StateMachine" unique_id=1171587216]
[node name="States" type="Node" parent="State Machine" unique_id=1171587216]
[node name="Idle State" type="Node" parent="StateMachine/States" unique_id=2017409248 node_paths=PackedStringArray("movement_component", "state_machine")]
[node name="Idle State" type="Node" parent="State Machine/States" unique_id=2017409248 node_paths=PackedStringArray("movement_component", "state_machine")]
script = ExtResource("4_dxcao")
movement_component = NodePath("../../../MovementComponent")
movement_component = NodePath("../../../Components/MovementComponent")
state_machine = NodePath("../..")
[node name="Walking State" type="Node" parent="StateMachine/States" unique_id=1661048365 node_paths=PackedStringArray("movement_component", "direction_component", "body", "state_machine")]
[node name="Walking State" type="Node" parent="State Machine/States" unique_id=1661048365 node_paths=PackedStringArray("movement_component", "direction_component", "body", "state_machine")]
script = ExtResource("5_cscr0")
movement_component = NodePath("../../../MovementComponent")
movement_component = NodePath("../../../Components/MovementComponent")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
body = NodePath("../../..")
state_machine = NodePath("../..")
[node name="Using Item A State" type="Node" parent="StateMachine/States" unique_id=1017153142 node_paths=PackedStringArray("body", "direction_component", "state_machine")]
[node name="Using Item A State" type="Node" parent="State Machine/States" unique_id=1017153142 node_paths=PackedStringArray("body", "direction_component", "state_machine")]
script = ExtResource("5_1mdwi")
body = NodePath("../../..")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
state_machine = NodePath("../..")
[node name="Drawing Bow State" type="Node" parent="StateMachine/States" unique_id=317681716 node_paths=PackedStringArray("movement_componenent", "body", "state_machine")]
[node name="Drawing Bow State" type="Node" parent="State Machine/States" unique_id=317681716 node_paths=PackedStringArray("movement_componenent", "body", "state_machine")]
script = ExtResource("7_cscr0")
movement_componenent = NodePath("../../../MovementComponent")
movement_componenent = NodePath("../../../Components/MovementComponent")
body = NodePath("../../..")
state_machine = NodePath("../..")
[node name="Firing Arrow State" type="Node" parent="StateMachine/States" unique_id=2129772816 node_paths=PackedStringArray("direction_component", "arrow_spawn_marker", "state_machine")]
[node name="Firing Arrow State" type="Node" parent="State Machine/States" unique_id=2129772816 node_paths=PackedStringArray("direction_component", "arrow_spawn_marker", "state_machine")]
script = ExtResource("8_plevq")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
arrow_spawn_marker = NodePath("../../../Marker2D")
state_machine = NodePath("../..")
[node name="Sitting State" type="Node" parent="StateMachine/States" unique_id=1774602333 node_paths=PackedStringArray("state_machine")]
[node name="Sitting State" type="Node" parent="State Machine/States" unique_id=1774602333 node_paths=PackedStringArray("state_machine")]
script = ExtResource("9_sdxbo")
state_machine = NodePath("../..")
[node name="Cutscene State" type="Node" parent="StateMachine/States" unique_id=1722986400 node_paths=PackedStringArray("state_machine")]
[node name="Cutscene State" type="Node" parent="State Machine/States" unique_id=1722986400 node_paths=PackedStringArray("state_machine")]
script = ExtResource("10_p06rw")
state_machine = NodePath("../..")
[node name="MovementComponent" type="Node" parent="." unique_id=1773880772 node_paths=PackedStringArray("body")]
script = ExtResource("4_apx8m")
body = NodePath("..")
[node name="Play Animation State" type="Node" parent="State Machine/States" unique_id=1357816619 node_paths=PackedStringArray("state_machine")]
script = ExtResource("12_aencf")
state_machine = NodePath("../..")
[node name="Occlusion Culling Area" type="Area2D" parent="." unique_id=1195961806]
collision_layer = 8
@@ -92,7 +99,7 @@ collision_mask = 0
shape = SubResource("CircleShape2D_plevq")
[node name="Player Sprite" parent="." unique_id=1169131604 node_paths=PackedStringArray("state_machine", "direction_component") instance=ExtResource("1_27cb7")]
state_machine = NodePath("../StateMachine")
state_machine = NodePath("../State Machine")
direction_component = NodePath("../Components/FacingDirectionComponent")
[node name="Marker2D" type="Marker2D" parent="." unique_id=2003544808]
@@ -109,17 +116,20 @@ position = Vector2(0, 9.5)
shape = SubResource("RectangleShape2D_fu1fx")
debug_color = Color(0.79959095, 0.41617078, 0.18507844, 0.41960785)
[connection signal="CutsceneEnded" from="." to="StateMachine/States/Cutscene State" method="OnCutsceneEnded"]
[connection signal="CutsceneStarted" from="." to="StateMachine/States/Idle State" method="OnCutsceneStarted"]
[connection signal="SitOnFurnitureTriggered" from="." to="StateMachine/States/Idle State" method="OnSitOnFurnitureTriggered"]
[connection signal="CutsceneEnded" from="." to="State Machine/States/Cutscene State" method="OnCutsceneEnded"]
[connection signal="CutsceneStarted" from="." to="State Machine/States/Idle State" method="OnCutsceneStarted"]
[connection signal="SitOnFurnitureTriggered" from="." to="State Machine/States/Idle State" method="OnSitOnFurnitureTriggered"]
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Player Sprite" method="UpdateSprite"]
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Marker2D/InteractScanner" method="OnDirectionChanged"]
[connection signal="PlayerBecameIdle" from="StateMachine/States/Idle State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganDrawingBow" from="StateMachine/States/Drawing Bow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganFiringArrow" from="StateMachine/States/Firing Arrow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerFiredArrow" from="StateMachine/States/Firing Arrow State" to="." method="_on_using_item_a_state_arrow_fired"]
[connection signal="DrawingBowAnimationFinished" from="Player Sprite" to="StateMachine/States/Drawing Bow State" method="OnDrawingBowAnimationFinished"]
[connection signal="FiringArrowAnimationFinished" from="Player Sprite" to="StateMachine/States/Firing Arrow State" method="OnFiringArrowAnimationFinished"]
[connection signal="PlayerBecameIdle" from="State Machine/States/Idle State" to="Player Sprite" method="UpdateSprite"]
[connection signal="StartedWalking" from="State Machine/States/Walking State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganDrawingBow" from="State Machine/States/Drawing Bow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganFiringArrow" from="State Machine/States/Firing Arrow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerFiredArrow" from="State Machine/States/Firing Arrow State" to="." method="_on_using_item_a_state_arrow_fired"]
[connection signal="PlayAnimation" from="State Machine/States/Play Animation State" to="Player Sprite" method="PlaySpecifiedAnimation"]
[connection signal="AnimationFinished" from="Player Sprite" to="State Machine/States/Play Animation State" method="OnAnimationFinished"]
[connection signal="DrawingBowAnimationFinished" from="Player Sprite" to="State Machine/States/Drawing Bow State" method="OnDrawingBowAnimationFinished"]
[connection signal="FiringArrowAnimationFinished" from="Player Sprite" to="State Machine/States/Firing Arrow State" method="OnFiringArrowAnimationFinished"]
[connection signal="InteractionActionTriggered" from="Marker2D/InteractScanner" to="." method="_on_interaction_action_triggered"]
[connection signal="area_entered" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_entered"]
[connection signal="area_exited" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_exited"]

View File

@@ -153,6 +153,26 @@ region = Rect2(256, 128, 64, 64)
atlas = ExtResource("2_ndjja")
region = Rect2(320, 128, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_e1olu"]
atlas = ExtResource("2_ndjja")
region = Rect2(0, 1280, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_jmdrl"]
atlas = ExtResource("2_ndjja")
region = Rect2(64, 1280, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_wk3mk"]
atlas = ExtResource("2_ndjja")
region = Rect2(128, 1280, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_8mpdo"]
atlas = ExtResource("2_ndjja")
region = Rect2(192, 1280, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_46inv"]
atlas = ExtResource("2_ndjja")
region = Rect2(256, 1280, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_s6rq5"]
atlas = ExtResource("2_ndjja")
region = Rect2(0, 192, 64, 64)
@@ -382,6 +402,26 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_e1olu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jmdrl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wk3mk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8mpdo")
}, {
"duration": 8.0,
"texture": SubResource("AtlasTexture_46inv")
}],
"loop": false,
"name": &"opening-chest-down",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_s6rq5")
}, {
"duration": 1.0,
@@ -1655,7 +1695,7 @@ script = ExtResource("1_jqxwg")
[node name="Full" type="AnimatedSprite2D" parent="." unique_id=1296959783]
position = Vector2(0, 7)
sprite_frames = SubResource("SpriteFrames_jqxwg")
animation = &"idle-down"
animation = &"opening-chest-down"
autoplay = "idle-down"
offset = Vector2(0, -7)