Dropping and picking up

This commit is contained in:
Marco 2025-03-28 19:47:10 +01:00
commit bcd007fa1e
14 changed files with 294 additions and 62 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=75 format=3 uid="uid://c4pr2707hbeph"]
[gd_scene load_steps=83 format=3 uid="uid://c4pr2707hbeph"]
[ext_resource type="Script" uid="uid://d2ubk5gucny6s" path="res://Scripts/Components/FSM/PlayerFSMProxy.cs" id="1_g3wua"]
[ext_resource type="Script" uid="uid://bw2hakslndaxm" path="res://Scripts/Components/FSM/PlayerStateMachine.cs" id="1_mpmil"]
@ -34,6 +34,13 @@
[ext_resource type="Texture2D" uid="uid://ddwhrlrgj6i00" path="res://Sprites/Actors/Cirno.png" id="30_li0ug"]
[ext_resource type="Script" uid="uid://camgjo4302qmq" path="res://Scripts/Components/Actors/ConveyorBeltMover.cs" id="32_4f2wn"]
[ext_resource type="Script" uid="uid://dbxbvjonbtib2" path="res://Scripts/Components/FSM/Player/PlayerStorageModule.cs" id="33_fnw0c"]
[ext_resource type="Script" uid="uid://bcpn47j3lr1tg" path="res://Scripts/Components/FSM/Player/DeathItemDropper.cs" id="35_qlmfy"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="36_v2m0j"]
[ext_resource type="Resource" uid="uid://cvlwye1u5gv8u" path="res://Resources/Items/Green_Points_Pickup.tres" id="37_awrib"]
[ext_resource type="Resource" uid="uid://cltxhkrqp055v" path="res://Resources/Items/Money_Pickup.tres" id="38_nfrn8"]
[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="39_nfq4p"]
[ext_resource type="Resource" uid="uid://clr1gln7nxa1o" path="res://Resources/Items/Power_Pickup.tres" id="40_m1iep"]
[ext_resource type="Script" uid="uid://c8f4tbcjcfsu1" path="res://Scripts/Components/FSM/Player/AutoPickupModule.cs" id="41_v2m0j"]
[sub_resource type="CircleShape2D" id="CircleShape2D_b3hxm"]
radius = 5.0
@ -308,6 +315,9 @@ _data = {
[sub_resource type="CircleShape2D" id="CircleShape2D_fnw0c"]
radius = 2.05679
[sub_resource type="CircleShape2D" id="CircleShape2D_qlmfy"]
radius = 3.16228
[node name="FSMPlayer" type="CharacterBody2D" node_paths=PackedStringArray("PlayerFSM", "InteractionController")]
process_mode = 1
collision_layer = 2
@ -339,7 +349,7 @@ _damageReceiver = NodePath("../../DamageReceiver")
_activationProvider = NodePath("../../InteractionProvider")
_interactionController = NodePath("../../InteractionController")
_storageModule = NodePath("../../Storage")
_moduleNodes = [NodePath("../../InteractionController"), NodePath("../../ItemUser"), NodePath("../../ConveyorBeltMover")]
_moduleNodes = [NodePath("../../InteractionController"), NodePath("../../ItemUser"), NodePath("../../ConveyorBeltMover"), NodePath("../../AutoPickupModule")]
[node name="Cutscene" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("_animationProvider")]
script = ExtResource("4_22ff8")
@ -462,6 +472,7 @@ shape = SubResource("CircleShape2D_7n10g")
[node name="Error" type="AudioStreamPlayer2D" parent="InteractionProvider"]
stream = ExtResource("24_5tmtw")
bus = &"Effects"
[node name="InteractionController" type="Area2D" parent="." node_paths=PackedStringArray("Health", "Shield")]
visible = false
@ -510,8 +521,25 @@ script = ExtResource("32_4f2wn")
position = Vector2(0, 6.48)
shape = SubResource("CircleShape2D_fnw0c")
[node name="Storage" type="Node2D" parent="."]
[node name="Storage" type="Node2D" parent="." node_paths=PackedStringArray("Root")]
script = ExtResource("33_fnw0c")
Root = NodePath("..")
[node name="DeathItemDropper" type="Node2D" parent="." node_paths=PackedStringArray("Storage", "HealthProvider")]
script = ExtResource("35_qlmfy")
Storage = NodePath("../Storage")
HealthProvider = NodePath("../DamageReceiver/HealthProvider")
ItemsToDrop = Array[ExtResource("36_v2m0j")]([ExtResource("37_awrib"), ExtResource("38_nfrn8"), ExtResource("39_nfq4p"), ExtResource("40_m1iep")])
DropSpeed = 80.0
[node name="AutoPickupModule" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
script = ExtResource("41_v2m0j")
[node name="CollisionShape2D" type="CollisionShape2D" parent="AutoPickupModule"]
visible = false
shape = SubResource("CircleShape2D_qlmfy")
[connection signal="area_entered" from="DamageReceiver" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]
[connection signal="area_entered" from="InteractionProvider" to="InteractionProvider" method="_on_interaction_controller_area_entered"]