8 Commits

Author SHA1 Message Date
00c4c1ddfa scene saved 2025-09-09 16:23:45 +02:00
f4d5a02e42 fucked up 2025-09-09 16:09:59 +02:00
5087cb58bc god dayum wall hugging on point man 2025-08-18 14:54:41 +02:00
4f9005d016 revamped megajump and air control 2025-08-07 16:13:21 +02:00
f905e55f65 revamped jump 2025-08-05 12:12:07 +02:00
0d6d1c86de moved movement code to player 2025-07-29 16:41:31 +02:00
ffdb3366a5 two empoered actions on cooldown 2025-07-29 11:08:02 +02:00
cd9e6da4e9 trying with cooldown 2025-07-28 18:51:51 +02:00
19 changed files with 877 additions and 648 deletions

View File

@ -250,5 +250,3 @@ func _editor_name() -> String:
return name return name
return resource_path.get_file().replace(".tres", "") return resource_path.get_file().replace(".tres", "")

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

View File

@ -1,36 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://lp2pt8mtj7ty"
path.s3tc="res://.godot/imported/kenney-green-checkerboar-cc0.png-2ce8609a39a655125c8e037014f6f2db.s3tc.ctex"
path.etc2="res://.godot/imported/kenney-green-checkerboar-cc0.png-2ce8609a39a655125c8e037014f6f2db.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://player_controller/Examples/MovementTestbed/Hills/kenney-green-checkerboar-cc0.png"
dest_files=["res://.godot/imported/kenney-green-checkerboar-cc0.png-2ce8609a39a655125c8e037014f6f2db.s3tc.ctex", "res://.godot/imported/kenney-green-checkerboar-cc0.png-2ce8609a39a655125c8e037014f6f2db.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -1,33 +0,0 @@
using Godot;
// This script is an example of how you can create game systems that
// interact with PlayerController. This script applies a low gravity effect
// to any PlayerController that enters the Area3D. It does this by modifying
// the value of AdditionalGravityPower owned by the Gravity child of
// PlayerController.
namespace Movementtests.player_controller.Examples.MovementTestbed;
public partial class LowGravityArea3D : Area3D
{
[Export] public float GravityReduction { set; get; } = 0.4f;
public override void _Ready()
{
BodyEntered += (Node3D body) =>
{
if (body is PlayerController player) {
player.Gravity.AdditionalGravityPower *= GravityReduction;
GD.Print("Low Gravity Zone Entered");
}
};
BodyExited += (Node3D body) =>
{
if (body is PlayerController player) {
player.Gravity.AdditionalGravityPower /= GravityReduction;
GD.Print("Low Gravity Zone Exited");
}
};
}
}

View File

@ -1 +0,0 @@
uid://ctypnlbfptf03

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=45 format=3 uid="uid://bei4nhkf8lwdo"] [gd_scene load_steps=44 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="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
[ext_resource type="Curve" uid="uid://c2a8soliruf35" path="res://systems/dash/dash_time_dilation.tres" id="2_2q0ik"] [ext_resource type="Curve" uid="uid://c2a8soliruf35" path="res://systems/dash/dash_time_dilation.tres" id="2_2q0ik"]
@ -13,7 +13,6 @@
[ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="8_obsfv"] [ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="8_obsfv"]
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"]
[ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="9_5p2qc"] [ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="9_5p2qc"]
[ext_resource type="Script" uid="uid://bt0xv2q8iv1vn" path="res://player_controller/Scripts/Gravity.cs" id="9_lsueh"]
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"] [ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"] [ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"]
[ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"] [ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"]
@ -23,12 +22,12 @@
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"] [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/dash.tres" id="12_34snm"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.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://b6k73aj5povgv" path="res://player_controller/Scripts/FieldOfView.cs" id="12_m2mxi"]
[ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://systems/inputs/base_mode/jump_pressed.tres" id="13_nob5r"]
[ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"] [ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"]
[ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="16_nob5r"] [ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="16_nob5r"]
[ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"] [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"] [ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="17_h6vvl"]
[ext_resource type="PackedScene" uid="uid://cqduhd4opgwvm" path="res://systems/dash/dash_system.tscn" id="18_q5h8a"] [ext_resource type="PackedScene" uid="uid://cqduhd4opgwvm" path="res://systems/dash/dash_system.tscn" id="18_q5h8a"]
[ext_resource type="Script" uid="uid://dyy5njw6pxoh4" path="res://systems/move/MoveSystem.cs" id="20_rxwoh"]
[ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="22_rpwev"] [ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="22_rpwev"]
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="24_q5h8a"] [ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="24_q5h8a"]
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="25_wv70j"] [ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="25_wv70j"]
@ -51,11 +50,26 @@ blend_mode = 1
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
script = ExtResource("1_poq2x") script = ExtResource("1_poq2x")
TimeScaleAimInAir = 0.15 WalkSpeed = 7.5
MaxJumpBoostAfterDashing = 0.7 AccelerationAir = 2.0
DecelerationAir = 0.1
Weight = 5.0
SimpleJumpStartVelocity = 8.0
SimpleJumpHangTimeInFrames = 1
SimpleJumpGravityLesseningFactor = 2.5
DoubleJumpStartVelocity = 15.0
DoubleJumpHangTimeInFrames = 3
DoubleJumpGravityLesseningFactor = 1.5
MegaJumpStartVelocity = 30.0
MegaJumpHangTimeInFrames = 12
MegaJumpGravityLesseningFactor = 1.2
WallJumpStartVelocity = 8.0
SimpleDashStrength = 15.0
PoweredDashStrength = 50.0
WallHugGravityLesseningFactor = 15.0
WallHugDownwardMaxSpeed = 8.0
WallHugHorizontalDeceleration = 0.5
MaxNumberOfDashActions = 2 MaxNumberOfDashActions = 2
PerfectlyTimedActionTimer = 0.3
BasicDashStrength = 15.0
DashTimeDilationCurve = ExtResource("2_2q0ik") DashTimeDilationCurve = ExtResource("2_2q0ik")
[node name="InputController" type="Node3D" parent="."] [node name="InputController" type="Node3D" parent="."]
@ -67,10 +81,11 @@ rotate_floorplane = ExtResource("5_4u7i3")
aim_down = ExtResource("8_obsfv") aim_down = ExtResource("8_obsfv")
aim_pressed = ExtResource("9_nob5r") aim_pressed = ExtResource("9_nob5r")
aim_released = ExtResource("8_lhb11") aim_released = ExtResource("8_lhb11")
jump = ExtResource("10_4u7i3")
jump_pressed = ExtResource("13_nob5r")
empower_down = ExtResource("10_nodcl") empower_down = ExtResource("10_nodcl")
empower_released = ExtResource("11_ruloh") empower_released = ExtResource("11_ruloh")
aim_canceled = ExtResource("9_5p2qc") aim_canceled = ExtResource("9_5p2qc")
jump = ExtResource("10_4u7i3")
hit = ExtResource("11_cresl") hit = ExtResource("11_cresl")
dash = ExtResource("12_34snm") dash = ExtResource("12_34snm")
throw = ExtResource("16_nob5r") throw = ExtResource("16_nob5r")
@ -135,20 +150,6 @@ target_position = Vector3(0, 1, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.296, 1.4, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.296, 1.4, 0)
target_position = Vector3(0, 1, 0) target_position = Vector3(0, 1, 0)
[node name="MoveSystem" type="Node3D" parent="."]
script = ExtResource("20_rxwoh")
WalkSpeed = 7.0
SprintSpeed = 7.0
AccelerationSpeedFactorFloor = 3.0
ApexHoldTime = 0.2
WallHugGravityReducingFactor = 0.2
[node name="Gravity" type="Node3D" parent="."]
script = ExtResource("9_lsueh")
Weight = 3.5
StartVelocity = 0.7
JumpFromDashSpeedFactor = 4.0
[node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")] [node name="TweenQueueSystem" parent="." instance=ExtResource("22_rpwev")]
[node name="WallHugSystem" type="Node3D" parent="."] [node name="WallHugSystem" type="Node3D" parent="."]
@ -182,12 +183,11 @@ transform = Transform3D(1, 0, 0, 0, 0.173648, -0.984808, 0, 0.984808, 0.173648,
ThrowForce = 15.0 ThrowForce = 15.0
StraightThrowDuration = 0.05 StraightThrowDuration = 0.05
[node name="CoyoteTime" type="Timer" parent="."] [node name="DashCooldown" type="Timer" parent="."]
wait_time = 0.2
one_shot = true one_shot = true
[node name="DashCooldown" type="Timer" parent="."] [node name="PowerCooldown" type="Timer" parent="."]
wait_time = 0.2 wait_time = 2.0
one_shot = true one_shot = true
[node name="TimeScaleAimInAir" type="Timer" parent="."] [node name="TimeScaleAimInAir" type="Timer" parent="."]
@ -195,20 +195,11 @@ wait_time = 2.0
one_shot = true one_shot = true
ignore_time_scale = true ignore_time_scale = true
[node name="TimeAfterDashing" type="Timer" parent="."]
wait_time = 0.3
one_shot = true
[node name="EmpowerTimeDownscale" type="Timer" parent="."]
one_shot = true
ignore_time_scale = true
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")] [node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
offset_left = 1524.0 offset_left = 1524.0
offset_top = 1.0 offset_top = 1.0
offset_right = -8.0 offset_right = -8.0
offset_bottom = 1.0 offset_bottom = 1.0
enabled = false
initial_node_to_watch = NodePath("../StateChart") initial_node_to_watch = NodePath("../StateChart")
[node name="UI" type="CanvasLayer" parent="."] [node name="UI" type="CanvasLayer" parent="."]
@ -241,6 +232,13 @@ layout_mode = 2
texture = ExtResource("30_h23go") texture = ExtResource("30_h23go")
expand_mode = 2 expand_mode = 2
[node name="DashCooldownIndicator" type="ColorRect" parent="UI"]
unique_name_in_owner = true
offset_left = 910.0
offset_top = 549.0
offset_right = 1010.0
offset_bottom = 559.0
[node name="CenterContainer" type="CenterContainer" parent="UI"] [node name="CenterContainer" type="CenterContainer" parent="UI"]
custom_minimum_size = Vector2(1920, 1080) custom_minimum_size = Vector2(1920, 1080)
offset_right = 1919.0 offset_right = 1919.0
@ -253,13 +251,6 @@ layout_mode = 2
texture = ExtResource("32_lgpc8") texture = ExtResource("32_lgpc8")
expand_mode = 1 expand_mode = 1
[node name="DashIndicator" type="TextureRect" parent="UI/CenterContainer"]
unique_name_in_owner = true
material = SubResource("CanvasItemMaterial_2q0ik")
layout_mode = 2
texture = ExtResource("32_lgpc8")
expand_mode = 1
[node name="StateChart" type="Node" parent="."] [node name="StateChart" type="Node" parent="."]
script = ExtResource("25_wv70j") script = ExtResource("25_wv70j")
metadata/_custom_type_script = "uid://couw105c3bde4" metadata/_custom_type_script = "uid://couw105c3bde4"
@ -320,24 +311,42 @@ to = NodePath("../../Off")
event = &"empower_released" event = &"empower_released"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Actions" type="Node" parent="StateChart/Root"] [node name="PowerReserve" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Default") initial_state = NodePath("Full")
[node name="Default" type="Node" parent="StateChart/Root/Actions"] [node name="ToExpired" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("28_n7qhm")
to = NodePath("../Expired")
event = &"expired"
delay_in_seconds = "0.0"
[node name="Recharge" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("28_n7qhm")
to = NodePath("../AtLeastOneCharge")
event = &"recharge"
delay_in_seconds = "0.0"
[node name="ToFull" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("28_n7qhm")
to = NodePath("../Full")
event = &"fully_charged"
delay_in_seconds = "0.0"
[node name="Expired" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Jumping" type="Node" parent="StateChart/Root/Actions"] [node name="AtLeastOneCharge" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Dashing" type="Node" parent="StateChart/Root/Actions"] [node name="Full" type="Node" parent="StateChart/Root/PowerReserve"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Hitting" type="Node" parent="StateChart/Root/Actions"] [node name="PowerUsed" type="Node" parent="StateChart/Root/PowerReserve/Full"]
script = ExtResource("27_34snm") script = ExtResource("28_n7qhm")
to = NodePath("../../AtLeastOneCharge")
[node name="Throwing" type="Node" parent="StateChart/Root/Actions"] event = &"power_used"
script = ExtResource("27_34snm") delay_in_seconds = "0.0"
[node name="WeaponState" type="Node" parent="StateChart/Root"] [node name="WeaponState" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
@ -381,18 +390,16 @@ script = ExtResource("27_34snm")
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Grounded") initial_state = NodePath("Grounded")
[node name="Reset" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("41_ruloh")
default_state = NodePath("../Grounded")
[node name="OnFall" type="Node" parent="StateChart/Root/Movement"] [node name="OnFall" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../Airborne/Falling") to = NodePath("../Airborne/Falling")
event = &"falling" event = &"falling"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Grounded/Standing")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement"] [node name="OnMantle" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../Mantling") to = NodePath("../Mantling")
@ -405,83 +412,113 @@ to = NodePath("../OnWall/Hanging")
event = &"dash_to_planted" event = &"dash_to_planted"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnDash" type="Node" parent="StateChart/Root/Movement"] [node name="OnPoweredDash" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../Dashing") to = NodePath("../Dashing/PoweredDash")
event = &"dash" event = &"powered_dash"
delay_in_seconds = "0.0"
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnDashEnded" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/Reset")
event = &"dash_ended"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Mantling" type="Node" parent="StateChart/Root/Movement"] [node name="Mantling" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnMantleFinished" type="Node" parent="StateChart/Root/Movement/Mantling"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Grounded")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="Jump" type="Node" parent="StateChart/Root/Movement"] [node name="Jump" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Normal") initial_state = NodePath("SimpleJump")
[node name="Normal" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="SimpleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Double" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/SimpleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/DoubleJumpEnabled")
event = &"jump_ended"
delay_in_seconds = "0.0"
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Empowered" type="Node" parent="StateChart/Root/Movement/Jump"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/DoubleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Falling")
event = &"jump_ended"
delay_in_seconds = "0.0"
[node name="MegaJump" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm")
[node name="OnJumpEnded" type="Node" parent="StateChart/Root/Movement/Jump/MegaJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Falling")
event = &"jump_ended"
delay_in_seconds = "0.0"
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6")
initial_state = NodePath("Dash")
[node name="OnDashEnded" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/Reset")
event = &"dash_finished"
delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Mantling")
event = &"mantle"
delay_in_seconds = "0.0"
[node name="Dash" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("27_34snm")
[node name="PoweredDash" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="Grounded" type="Node" parent="StateChart/Root/Movement"] [node name="Grounded" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6")
initial_state = NodePath("Standing")
[node name="Standing" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"] [node name="OnDash" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/DoubleJumpEnabled") to = NodePath("../../Dashing/Dash")
event = &"dash"
delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Jump/SimpleJump")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnAirborne" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"] [node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled") to = NodePath("../../Jump/MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnAirborne" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/CoyoteEnabled")
event = &"start_falling" event = &"start_falling"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnCrouch" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Crouched")
event = &"crouch"
delay_in_seconds = "0.0"
[node name="Crouched" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/DoubleJumpEnabled")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnAirborne" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"start_falling"
delay_in_seconds = "0.0"
[node name="OnStandUp" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Standing")
event = &"crouch"
delay_in_seconds = "0.0"
[node name="Airborne" type="Node" parent="StateChart/Root/Movement"] [node name="Airborne" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("CoyoteEnabled") initial_state = NodePath("CoyoteEnabled")
@ -496,12 +533,30 @@ to = NodePath("../../OnWall/Hugging")
event = &"wall_hug" event = &"wall_hug"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnDash" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Dashing/Dash")
event = &"dash"
delay_in_seconds = "0.0"
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Grounded")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJumpEnabled") to = NodePath("../../../Jump/SimpleJump")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
@ -514,9 +569,15 @@ delay_in_seconds = "0.0"
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Jump/MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Falling") to = NodePath("../../../Jump/DoubleJump")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
@ -533,28 +594,61 @@ delay_in_seconds = "0.0"
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Hugging") initial_state = NodePath("Hugging")
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Grounded")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/DoubleJumpEnabled") to = NodePath("../../Jump/DoubleJump")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnMegajump" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Jump/MegaJump")
event = &"megajump"
delay_in_seconds = "0.0"
[node name="HugCanceled" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm")
[node name="ToHanging" type="Node" parent="StateChart/Root/Movement/OnWall/HugCanceled"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Hanging")
event = &"oh_hit_wall"
delay_in_seconds = "0.0"
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Grounded")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"] [node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled") to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"start_falling" event = &"start_falling"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../HugCanceled")
event = &"dash"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"] [node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/OnWall/Hanging"] [node name="OnDrop" type="Node" parent="StateChart/Root/Movement/OnWall/Hanging"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled") to = NodePath("../../Hugging")
event = &"cancel" event = &"dash"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"] [connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
@ -565,8 +659,11 @@ delay_in_seconds = "0.0"
[connection signal="input_empower_down" from="InputController" to="." method="OnInputEmpowerDown"] [connection signal="input_empower_down" from="InputController" to="." method="OnInputEmpowerDown"]
[connection signal="input_empower_released" from="InputController" to="." method="OnInputEmpowerReleased"] [connection signal="input_empower_released" from="InputController" to="." method="OnInputEmpowerReleased"]
[connection signal="input_hit" from="InputController" to="." method="OnInputHitPressed"] [connection signal="input_hit" from="InputController" to="." method="OnInputHitPressed"]
[connection signal="input_jump" from="InputController" to="." method="OnInputJumpPressed"] [connection signal="input_jump_ended" from="InputController" to="." method="OnInputJumpEnded"]
[connection signal="input_jump_ongoing" from="InputController" to="." method="OnInputJumpOngoing"]
[connection signal="input_jump_started" from="InputController" to="." method="OnInputJumpStarted"]
[connection signal="input_move" from="InputController" to="." method="OnInputMove"] [connection signal="input_move" from="InputController" to="." method="OnInputMove"]
[connection signal="input_rotate_floorplane" from="InputController" to="." method="OnInputRotateFloorplane"] [connection signal="input_rotate_floorplane" from="InputController" to="." method="OnInputRotateFloorplane"]
[connection signal="input_rotate_y" from="InputController" to="." method="OnInputRotateY"] [connection signal="input_rotate_y" from="InputController" to="." method="OnInputRotateY"]
[connection signal="input_throw" from="InputController" to="." method="OnInputThrowPressed"] [connection signal="input_throw" from="InputController" to="." method="OnInputThrowPressed"]
[connection signal="WallDetected" from="WallHugSystem" to="." method="OnWallDetected"]

View File

@ -107,7 +107,6 @@ public partial class HealthSystem : Node3D
private float _currentHealthInPrevFrame; private float _currentHealthInPrevFrame;
private float _currentVelocityYInAir; private float _currentVelocityYInAir;
private Gravity _gravity;
private CharacterBody3D _characterBody3D; private CharacterBody3D _characterBody3D;
@ -144,7 +143,6 @@ public partial class HealthSystem : Node3D
public struct HealthSystemInitParams public struct HealthSystemInitParams
{ {
public Gravity Gravity;
public CharacterBody3D Parent; public CharacterBody3D Parent;
public Camera3D Camera; public Camera3D Camera;
public Node3D Head; public Node3D Head;
@ -160,7 +158,6 @@ public partial class HealthSystem : Node3D
_currentSpeed = SpeedMin; _currentSpeed = SpeedMin;
_gravity = initParams.Gravity;
_characterBody3D = initParams.Parent; _characterBody3D = initParams.Parent;
_camera = initParams.Camera; _camera = initParams.Camera;

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ warnings/check_invalid_track_paths=false
[application] [application]
config/name="Movement tests" config/name="Movement tests"
run/main_scene="uid://dwo50456dv6va" run/main_scene="uid://pk8ypa04qy6x"
config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/features=PackedStringArray("4.4", "C#", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"

View File

@ -4,6 +4,9 @@ namespace Movementtests.systems;
public partial class DashSystem: Node3D public partial class DashSystem: Node3D
{ {
public record DashLocation(bool HasHit, Vector3 TargetLocation);
[Export(PropertyHint.Range, "0,0.2,0.01,or_greater")] [Export(PropertyHint.Range, "0,0.2,0.01,or_greater")]
public float DashSpeed { get; set; } = 0.1f; public float DashSpeed { get; set; } = 0.1f;
[Export(PropertyHint.Range, "0,1000,1,or_greater")] [Export(PropertyHint.Range, "0,1000,1,or_greater")]
@ -60,14 +63,14 @@ public partial class DashSystem: Node3D
_dashIndicatorAnim = GetNode<AnimationPlayer>("DashIndicator/AnimationPlayer"); _dashIndicatorAnim = GetNode<AnimationPlayer>("DashIndicator/AnimationPlayer");
} }
private void ComputeDashLocation() private DashLocation ComputeDashLocation()
{ {
TargetLocation = _dashCast3D.ToGlobal(_dashCast3D.TargetPosition);
HasHit = _dashCast3D.IsColliding(); var targetLocation = _dashCast3D.ToGlobal(_dashCast3D.TargetPosition);
if (!HasHit) var hasHit = _dashCast3D.IsColliding();
if (!hasHit)
{ {
PlannedPlayerLocation = TargetLocation; return new DashLocation(false, targetLocation);
return;
} }
CollisionPoint = _dashCast3D.GetCollisionPoint(0); CollisionPoint = _dashCast3D.GetCollisionPoint(0);
@ -80,12 +83,23 @@ public partial class DashSystem: Node3D
// Pushes the point down when dashing to under a platform so head doesn't clip // Pushes the point down when dashing to under a platform so head doesn't clip
var maxPushDownDistance = 0.9f; var maxPushDownDistance = 0.9f;
var correctionProportion = (float) Mathf.Remap(CollisionNormal.Y, -0.5, -1, 0, 1); var correctionProportion = (float) Mathf.Remap(CollisionNormal.Y, -0.5, -1, 0, 1);
var proportion = (float) Mathf.Remap(_dashCast3D.GlobalRotation.X, 0, 1.57, 0, 1); var proportion = (float)Mathf.Remap(_dashCast3D.GlobalRotation.X, 0, 1.57, 0, 1);
PlannedPlayerLocation = locationAlongPath var finalLocation = locationAlongPath
+ CollisionNormal + CollisionNormal
* maxPushDownDistance * maxPushDownDistance
* Mathf.Clamp(proportion, 0, 1) * Mathf.Clamp(proportion, 0, 1)
* Mathf.Clamp(correctionProportion, 0, 1); * Mathf.Clamp(correctionProportion, 0, 1);
return new DashLocation(true, finalLocation);
}
public DashLocation GetDashLocationInDirection(Vector3 direction)
{
var angle = Mathf.Atan2(direction.X, direction.Z);
GD.Print(angle);
var rotation = _head.Rotation.Y + angle*2.0f;
_dashCast3D.SetRotation(new Vector3(0, rotation, 0));
return ComputeDashLocation();
} }
public void PrepareDash() public void PrepareDash()
@ -97,7 +111,7 @@ public partial class DashSystem: Node3D
_head.Rotation.Y, _head.Rotation.Y,
_camera.Rotation.Z)); _camera.Rotation.Z));
ComputeDashLocation(); (HasHit, PlannedPlayerLocation) = ComputeDashLocation();
ShouldMantle = false; ShouldMantle = false;
var mantleLocation = Vector3.Zero; var mantleLocation = Vector3.Zero;

View File

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=86 format=3 uid="uid://bl5crtu1gkrtr"] [gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=90 format=3 uid="uid://bl5crtu1gkrtr"]
[ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_qmhk6"] [ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_qmhk6"]
[ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="2_g6bbx"] [ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="2_g6bbx"]
@ -28,6 +28,7 @@
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="23_g6bbx"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="23_g6bbx"]
[ext_resource type="Script" uid="uid://dsa1dnifd6w32" path="res://addons/guide/guide_mapping_context.gd" id="23_llfhp"] [ext_resource type="Script" uid="uid://dsa1dnifd6w32" path="res://addons/guide/guide_mapping_context.gd" id="23_llfhp"]
[ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="24_yp12v"] [ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="24_yp12v"]
[ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://systems/inputs/base_mode/jump_pressed.tres" id="25_si4d4"]
[sub_resource type="Resource" id="Resource_vkvga"] [sub_resource type="Resource" id="Resource_vkvga"]
script = ExtResource("4_1rw8g") script = ExtResource("4_1rw8g")
@ -183,30 +184,6 @@ script = ExtResource("1_qmhk6")
action = ExtResource("16_li5ak") action = ExtResource("16_li5ak")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_r6kml")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_r6kml")])
[sub_resource type="Resource" id="Resource_fykw6"]
script = ExtResource("10_cvxqo")
axis = 5
joy_index = -1
[sub_resource type="Resource" id="Resource_rvpjj"]
script = ExtResource("15_g6bbx")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_s8kjn"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_fykw6")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_rvpjj")])
[sub_resource type="Resource" id="Resource_vibkn"]
script = ExtResource("1_qmhk6")
action = ExtResource("16_0qat1")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_s8kjn")])
[sub_resource type="Resource" id="Resource_cqc4k"] [sub_resource type="Resource" id="Resource_cqc4k"]
script = ExtResource("10_cvxqo") script = ExtResource("10_cvxqo")
axis = 4 axis = 4
@ -232,6 +209,31 @@ action = ExtResource("16_rvpjj")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_bkx7d")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_bkx7d")])
metadata/_guide_input_mappings_collapsed = false metadata/_guide_input_mappings_collapsed = false
[sub_resource type="Resource" id="Resource_fykw6"]
script = ExtResource("10_cvxqo")
axis = 5
joy_index = -1
[sub_resource type="Resource" id="Resource_rvpjj"]
script = ExtResource("15_fykw6")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_s8kjn"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_fykw6")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_rvpjj")])
metadata/_guide_triggers_collapsed = false
[sub_resource type="Resource" id="Resource_vibkn"]
script = ExtResource("1_qmhk6")
action = ExtResource("16_0qat1")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_s8kjn")])
[sub_resource type="Resource" id="Resource_qkgmj"] [sub_resource type="Resource" id="Resource_qkgmj"]
script = ExtResource("10_cvxqo") script = ExtResource("10_cvxqo")
axis = 5 axis = 5
@ -280,15 +282,36 @@ script = ExtResource("1_qmhk6")
action = ExtResource("18_vibkn") action = ExtResource("18_vibkn")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_4ee3d")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_4ee3d")])
[sub_resource type="Resource" id="Resource_oapce"] [sub_resource type="Resource" id="Resource_1fkas"]
script = ExtResource("19_qkgmj") script = ExtResource("19_qkgmj")
button = 0 button = 0
joy_index = -1 joy_index = -1
[sub_resource type="Resource" id="Resource_j3mg7"] [sub_resource type="Resource" id="Resource_6pxii"]
script = ExtResource("15_fykw6") script = ExtResource("15_fykw6")
actuation_threshold = 0.5 actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_jy4f1"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_1fkas")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_6pxii")])
metadata/_guide_triggers_collapsed = false
[sub_resource type="Resource" id="Resource_d2r0d"]
script = ExtResource("1_qmhk6")
action = ExtResource("25_si4d4")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_jy4f1")])
[sub_resource type="Resource" id="Resource_oapce"]
script = ExtResource("19_qkgmj")
button = 0
joy_index = -1
[sub_resource type="Resource" id="Resource_8w5gu"] [sub_resource type="Resource" id="Resource_8w5gu"]
script = ExtResource("3_yp12v") script = ExtResource("3_yp12v")
override_action_settings = false override_action_settings = false
@ -297,7 +320,7 @@ display_name = ""
display_category = "" display_category = ""
input = SubResource("Resource_oapce") input = SubResource("Resource_oapce")
modifiers = Array[ExtResource("5_0qat1")]([]) modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_j3mg7")]) triggers = Array[ExtResource("8_2tfaw")]([])
metadata/_guide_triggers_collapsed = false metadata/_guide_triggers_collapsed = false
[sub_resource type="Resource" id="Resource_xt1x5"] [sub_resource type="Resource" id="Resource_xt1x5"]
@ -381,5 +404,5 @@ input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_v2ywt")])
[resource] [resource]
script = ExtResource("23_llfhp") script = ExtResource("23_llfhp")
display_name = "" display_name = ""
mappings = Array[ExtResource("1_qmhk6")]([SubResource("Resource_88x08"), SubResource("Resource_tgr2g"), SubResource("Resource_iarn8"), SubResource("Resource_cvxqo"), SubResource("Resource_tb8ii"), SubResource("Resource_vibkn"), SubResource("Resource_iihs4"), SubResource("Resource_2hs2y"), SubResource("Resource_0s4kt"), SubResource("Resource_xt1x5"), SubResource("Resource_ew1hw"), SubResource("Resource_0qat1"), SubResource("Resource_vtk18")]) mappings = Array[ExtResource("1_qmhk6")]([SubResource("Resource_88x08"), SubResource("Resource_tgr2g"), SubResource("Resource_iarn8"), SubResource("Resource_cvxqo"), SubResource("Resource_tb8ii"), SubResource("Resource_iihs4"), SubResource("Resource_vibkn"), SubResource("Resource_2hs2y"), SubResource("Resource_0s4kt"), SubResource("Resource_d2r0d"), SubResource("Resource_xt1x5"), SubResource("Resource_ew1hw"), SubResource("Resource_0qat1"), SubResource("Resource_vtk18")])
metadata/_custom_type_script = "uid://dsa1dnifd6w32" metadata/_custom_type_script = "uid://dsa1dnifd6w32"

View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://55b0dsvioj08"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_4yfi4"]
[resource]
script = ExtResource("1_4yfi4")
name = &""
action_value_type = 0
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

View File

@ -10,13 +10,17 @@ class_name InputController
@export var rotate_floorplane:GUIDEAction @export var rotate_floorplane:GUIDEAction
@export_group("Trigger actions") @export_group("Trigger actions")
@export_subgroup("Aim")
@export var aim_down:GUIDEAction @export var aim_down:GUIDEAction
@export var aim_pressed:GUIDEAction @export var aim_pressed:GUIDEAction
@export var aim_released:GUIDEAction @export var aim_released:GUIDEAction
@export_subgroup("Jump")
@export var jump:GUIDEAction
@export var jump_pressed:GUIDEAction
@export_subgroup("Other")
@export var empower_down:GUIDEAction @export var empower_down:GUIDEAction
@export var empower_released:GUIDEAction @export var empower_released:GUIDEAction
@export var aim_canceled:GUIDEAction @export var aim_canceled:GUIDEAction
@export var jump:GUIDEAction
@export var hit:GUIDEAction @export var hit:GUIDEAction
@export var dash:GUIDEAction @export var dash:GUIDEAction
@export var throw:GUIDEAction @export var throw:GUIDEAction
@ -25,13 +29,19 @@ signal input_move(value: Vector3)
signal input_rotate_y(value: float) signal input_rotate_y(value: float)
signal input_rotate_floorplane(value: float) signal input_rotate_floorplane(value: float)
signal input_aim_down # Jump
signal input_jump_started
signal input_jump_ongoing
signal input_jump_ended
signal input_aim_pressed signal input_aim_pressed
signal input_aim_down
signal input_aim_released signal input_aim_released
signal input_empower_down signal input_empower_down
signal input_empower_released signal input_empower_released
signal input_aim_canceled signal input_aim_canceled
signal input_jump
signal input_hit signal input_hit
signal input_dash signal input_dash
signal input_throw signal input_throw
@ -45,7 +55,11 @@ func _ready() -> void:
empower_down.triggered.connect(on_input_empower_down) empower_down.triggered.connect(on_input_empower_down)
empower_released.triggered.connect(on_input_empower_released) empower_released.triggered.connect(on_input_empower_released)
aim_canceled.triggered.connect(on_input_aim_canceled) aim_canceled.triggered.connect(on_input_aim_canceled)
jump.triggered.connect(on_input_jump)
jump_pressed.triggered.connect(on_input_jump_started)
jump.triggered.connect(on_input_jump_ongoing)
jump.completed.connect(on_input_jump_ended)
hit.triggered.connect(on_input_hit) hit.triggered.connect(on_input_hit)
dash.triggered.connect(on_input_dash) dash.triggered.connect(on_input_dash)
throw.triggered.connect(on_input_throw) throw.triggered.connect(on_input_throw)
@ -59,8 +73,14 @@ func on_input_throw():
func on_input_hit(): func on_input_hit():
input_hit.emit() input_hit.emit()
func on_input_jump(): func on_input_jump_started():
input_jump.emit() input_jump_started.emit()
func on_input_jump_ongoing():
input_jump_ongoing.emit()
func on_input_jump_ended():
input_jump_ended.emit()
func on_input_aim_down(): func on_input_aim_down():
input_aim_down.emit() input_aim_down.emit()

View File

@ -0,0 +1,5 @@
[gd_resource type="Curve" format=3 uid="uid://buxwd3wd0nln5"]
[resource]
_data = [Vector2(0, 0), 0.0, 3.01651, 0, 0, Vector2(0.996169, 1), 0.0, 0.0, 0, 0]
point_count = 2

View File

@ -5,8 +5,11 @@ using RustyOptions;
namespace Movementtests.systems; namespace Movementtests.systems;
public partial class WallHugSystem : Node3D public partial class WallHugSystem : Node3D
{ {
[Signal]
public delegate void WallDetectedEventHandler();
private List<RayCast3D> _raycasts; private List<RayCast3D> _raycasts;
@ -19,6 +22,13 @@ public partial class WallHugSystem : Node3D
_raycasts.Add(GetNode<RayCast3D>("right")); _raycasts.Add(GetNode<RayCast3D>("right"));
} }
public override void _PhysicsProcess(double delta)
{
base._PhysicsProcess(delta);
if (IsWallHugging())
EmitSignal(SignalName.WallDetected);
}
public bool IsWallHugging() public bool IsWallHugging()
{ {
foreach (RayCast3D raycast in _raycasts) foreach (RayCast3D raycast in _raycasts)