gd: added the drop action. Set up state managed coyote time, jump, double jump and overall movement.

This commit is contained in:
2025-06-10 10:30:15 +02:00
parent 974e0bb522
commit 141688ef32
6 changed files with 321 additions and 111 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=33 format=3 uid="uid://bei4nhkf8lwdo"]
[gd_scene load_steps=34 format=3 uid="uid://bei4nhkf8lwdo"]
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"]
@ -17,6 +17,7 @@
[ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"]
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"]
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"]
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/drop.tres" id="12_34snm"]
[ext_resource type="Script" uid="uid://b6k73aj5povgv" path="res://player_controller/Scripts/FieldOfView.cs" id="12_m2mxi"]
[ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"]
[ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="17_h6vvl"]
@ -49,6 +50,7 @@ aim_released = ExtResource("8_lhb11")
aim_canceled = ExtResource("9_5p2qc")
jump = ExtResource("10_4u7i3")
hit = ExtResource("11_cresl")
drop = ExtResource("12_34snm")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
@ -127,7 +129,6 @@ offset_left = 840.0
offset_top = 1.0
offset_right = -2.0
offset_bottom = 1.0
enabled = false
initial_node_to_watch = NodePath("../StateChart")
[node name="WeaponRoot" type="Node3D" parent="."]
@ -138,6 +139,7 @@ ThrowForce = 25.0
StraightThrowDuration = 0.07
[node name="CoyoteTime" type="Timer" parent="."]
wait_time = 0.2
[node name="StateChart" type="Node" parent="."]
script = ExtResource("25_wv70j")
@ -199,7 +201,7 @@ delay_in_seconds = "0.0"
[node name="WeaponThrown" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm")
[node name="ToDashing" type="Node" parent="StateChart/Root/Actions/WeaponThrown"]
[node name="OnAim" type="Node" parent="StateChart/Root/Actions/WeaponThrown"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Dashing")
event = &"aim_pressed"
@ -208,22 +210,46 @@ delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm")
[node name="ToWeaponInHand" type="Node" parent="StateChart/Root/Actions/Hanging"]
[node name="OnJump" type="Node" parent="StateChart/Root/Actions/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnDrop" type="Node" parent="StateChart/Root/Actions/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand")
event = &"drop"
delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Actions/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand")
event = &"mantle"
delay_in_seconds = "0.0"
[node name="Movement" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6")
initial_state = NodePath("Grounded")
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Mantling")
event = &"mantle"
delay_in_seconds = "0.0"
[node name="OnHang" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Hanging")
event = &"dash_to_planted"
delay_in_seconds = "0.0"
[node name="Grounded" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/DoubleJumpEnabled")
to = NodePath("../../Airborne/Jump")
event = &"jump"
delay_in_seconds = "0.0"
@ -233,28 +259,43 @@ to = NodePath("../../Airborne/CoyoteEnabled")
event = &"start_falling"
delay_in_seconds = "0.0"
[node name="Mantling" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="ToGrounded" type="Node" parent="StateChart/Root/Movement/Mantling"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Grounded")
event = &"to_grounded"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/DoubleJumpEnabled")
to = NodePath("../../Airborne/Jump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/CoyoteEnabled")
event = &"drop"
delay_in_seconds = "0.0"
[node name="WallHugging" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/WallHugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/DoubleJumpEnabled")
to = NodePath("../../Airborne/Jump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/WallHugging"]
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/WallHugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/CoyoteEnabled")
event = &"start_falling"
event = &"drop"
delay_in_seconds = "0.0"
[node name="Airborne" type="Node" parent="StateChart/Root/Movement"]
@ -272,7 +313,7 @@ script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJumpEnabled")
to = NodePath("../../Jump")
event = &"jump"
delay_in_seconds = "0.0"
@ -282,21 +323,40 @@ to = NodePath("../../DoubleJumpEnabled")
event = &"coyote_expired"
delay_in_seconds = "0.0"
[node name="Jump" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Jump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJumpEnabled")
event = &"to_double_jump"
delay_in_seconds = "0.0"
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
to = NodePath("../../DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="ToFalling" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
event = &"to_falling"
delay_in_seconds = "0.0"
[node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]
[connection signal="input_aim_released" from="InputController" to="." method="OnInputAimReleased"]
[connection signal="input_drop" from="InputController" to="." method="OnInputDropPressed"]
[connection signal="input_hit" from="InputController" to="." method="OnInputHitPressed"]
[connection signal="input_jump" from="InputController" to="." method="OnInputJumpPressed"]
[connection signal="input_move" from="InputController" to="." method="OnInputMove"]