revamped jump
This commit is contained in:
@ -250,5 +250,3 @@ func _editor_name() -> String:
|
||||
return name
|
||||
|
||||
return resource_path.get_file().replace(".tres", "")
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=43 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="Curve" uid="uid://c2a8soliruf35" path="res://systems/dash/dash_time_dilation.tres" id="2_2q0ik"]
|
||||
@ -22,6 +22,7 @@
|
||||
[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="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="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"]
|
||||
@ -50,8 +51,10 @@ blend_mode = 1
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
script = ExtResource("1_poq2x")
|
||||
AccelerationSpeedFactorFloor = 3.0
|
||||
Weight = 3.5
|
||||
StartVelocity = 0.7
|
||||
Weight = 5.0
|
||||
SimpleJumpStartVelocity = 7.0
|
||||
HangTimeInFrames = 3
|
||||
GravityLesseningFactorUpward = 2.5
|
||||
JumpFromDashSpeedFactor = 4.0
|
||||
WallHugHorizontalDeceleration = 3.0
|
||||
MaxJumpBoostAfterDashing = 0.7
|
||||
@ -69,10 +72,11 @@ rotate_floorplane = ExtResource("5_4u7i3")
|
||||
aim_down = ExtResource("8_obsfv")
|
||||
aim_pressed = ExtResource("9_nob5r")
|
||||
aim_released = ExtResource("8_lhb11")
|
||||
jump = ExtResource("10_4u7i3")
|
||||
jump_pressed = ExtResource("13_nob5r")
|
||||
empower_down = ExtResource("10_nodcl")
|
||||
empower_released = ExtResource("11_ruloh")
|
||||
aim_canceled = ExtResource("9_5p2qc")
|
||||
jump = ExtResource("10_4u7i3")
|
||||
hit = ExtResource("11_cresl")
|
||||
dash = ExtResource("12_34snm")
|
||||
throw = ExtResource("16_nob5r")
|
||||
@ -174,7 +178,7 @@ StraightThrowDuration = 0.05
|
||||
wait_time = 0.2
|
||||
one_shot = true
|
||||
|
||||
[node name="DashCooldown" type="Timer" parent="."]
|
||||
[node name="PowerCooldown" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
@ -411,12 +415,6 @@ to = NodePath("../Airborne/Falling")
|
||||
event = &"falling"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../Grounded")
|
||||
event = &"grounded"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../Mantling")
|
||||
@ -449,11 +447,17 @@ script = ExtResource("27_34snm")
|
||||
|
||||
[node name="Jump" type="Node" parent="StateChart/Root/Movement"]
|
||||
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")
|
||||
|
||||
[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="Double" type="Node" parent="StateChart/Root/Movement/Jump"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
@ -465,7 +469,7 @@ script = ExtResource("27_34snm")
|
||||
|
||||
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Airborne/DoubleJumpEnabled")
|
||||
to = NodePath("../../Jump/SimpleJump")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
@ -489,6 +493,12 @@ initial_state = NodePath("CoyoteEnabled")
|
||||
script = ExtResource("41_ruloh")
|
||||
default_state = NodePath("../CoyoteEnabled")
|
||||
|
||||
[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="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../OnWall/Hugging")
|
||||
@ -500,7 +510,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/SimpleJump")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
@ -591,7 +601,9 @@ delay_in_seconds = "0.0"
|
||||
[connection signal="input_empower_down" from="InputController" to="." method="OnInputEmpowerDown"]
|
||||
[connection signal="input_empower_released" from="InputController" to="." method="OnInputEmpowerReleased"]
|
||||
[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_rotate_floorplane" from="InputController" to="." method="OnInputRotateFloorplane"]
|
||||
[connection signal="input_rotate_y" from="InputController" to="." method="OnInputRotateY"]
|
||||
|
@ -31,7 +31,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
public WallHugSystem WallHugSystem;
|
||||
public PlayerUi PlayerUi;
|
||||
public TextureRect DashIndicator;
|
||||
public ColorRect DashCooldownIndicator;
|
||||
public ColorRect PowerCooldownIndicator;
|
||||
|
||||
private bool _movementEnabled = true;
|
||||
|
||||
@ -52,7 +52,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
private Timer _coyoteTimer;
|
||||
private Timer _timeScaleAimInAirTimer;
|
||||
private Timer _timeAfterDashingTimer;
|
||||
private Timer _dashCooldownTimer;
|
||||
private Timer _powerCooldownTimer;
|
||||
private Timer _empowerTimeDownscale;
|
||||
|
||||
[ExportCategory("Movement")]
|
||||
@ -68,7 +68,21 @@ public partial class PlayerController : CharacterBody3D
|
||||
public float DecelerationSpeedFactorAir = 1.0f;
|
||||
[Export(PropertyHint.Range, "0,10,0.01,or_greater")]
|
||||
public float Weight { get; set; } = 3.0f;
|
||||
|
||||
// Jump
|
||||
[ExportGroup("Jump")]
|
||||
|
||||
// Simple jump
|
||||
[ExportSubgroup("Simple jump")]
|
||||
[Export(PropertyHint.Range, "0,100,1,or_greater")]
|
||||
public float SimpleJumpStartVelocity { get; set; } = 3.0f;
|
||||
[Export(PropertyHint.Range, "0,10,1,or_greater")]
|
||||
public int HangTimeInFrames { get; set; } = 5;
|
||||
[Export(PropertyHint.Range, "1,10,0.1,or_greater")]
|
||||
public float GravityLesseningFactorUpward { get; set; } = 3f;
|
||||
|
||||
// Other jump
|
||||
[ExportSubgroup("Other jump")]
|
||||
[Export(PropertyHint.Range, "0,2,0.01,or_greater")]
|
||||
public float StartVelocity { get; set; } = 1.0f;
|
||||
[Export(PropertyHint.Range, "0.1,10,0.1,or_greater")]
|
||||
@ -138,6 +152,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
private StateChartState _movHanging;
|
||||
private StateChartState _airborne;
|
||||
private StateChartState _coyoteEnabled;
|
||||
private StateChartState _simpleJump;
|
||||
private StateChartState _doubleJumpEnabled;
|
||||
private StateChartState _onWall;
|
||||
private StateChartState _onWallHugCanceled;
|
||||
@ -155,8 +170,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
|
||||
PlayerUi = GetNode<PlayerUi>("UI");
|
||||
// DashIndicator = GetNode<TextureRect>("%DashIndicator");
|
||||
DashCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
|
||||
DashCooldownIndicator.Visible = false;
|
||||
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
|
||||
PowerCooldownIndicator.Visible = false;
|
||||
EmpoweredActionsLeft = MaxNumberOfDashActions;
|
||||
_targetSpeed = WalkSpeed;
|
||||
|
||||
@ -214,6 +229,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
_movHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
|
||||
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
|
||||
_coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled"));
|
||||
_simpleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Jump/SimpleJump"));
|
||||
_doubleJumpEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJumpEnabled"));
|
||||
_onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall"));
|
||||
_onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging"));
|
||||
@ -222,7 +238,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
_falling = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/Falling"));
|
||||
// State timers
|
||||
_coyoteTimer = GetNode<Timer>("CoyoteTime");
|
||||
_dashCooldownTimer = GetNode<Timer>("DashCooldown");
|
||||
_powerCooldownTimer = GetNode<Timer>("PowerCooldown");
|
||||
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
|
||||
_timeAfterDashingTimer = GetNode<Timer>("TimeAfterDashing");
|
||||
_empowerTimeDownscale = GetNode<Timer>("EmpowerTimeDownscale");
|
||||
@ -295,33 +311,125 @@ public partial class PlayerController : CharacterBody3D
|
||||
// _empowerOff.StateEntered += EmpowerStopped;
|
||||
// _empowerTimeDownscale.Timeout += EmpowerTimerTimeout;
|
||||
|
||||
_powerFull.StateExited += StartDashCooldown;
|
||||
_powerRecharging.StateEntered += StartDashCooldown;
|
||||
_powerFull.StateEntered += StopDashCooldown;
|
||||
_dashCooldownTimer.Timeout += DashCooldownExpired;
|
||||
_powerFull.StateExited += StartPowerCooldown;
|
||||
_powerRecharging.StateEntered += StartPowerCooldown;
|
||||
_powerFull.StateEntered += StopPowerCooldown;
|
||||
_powerCooldownTimer.Timeout += PowerCooldownExpired;
|
||||
_powerRecharging.StateProcessing += PowerRecharging;
|
||||
_powerExpired.StateProcessing += PowerRecharging;
|
||||
|
||||
_simpleJump.StateEntered += OnSimpleJumpStarted;
|
||||
_simpleJump.StatePhysicsProcessing += HandleSimpleJump;
|
||||
_simpleJump.StateExited += OnSimpleJumpEnded;
|
||||
}
|
||||
|
||||
public void OnInputJumpStarted()
|
||||
{
|
||||
if (CanMantle())
|
||||
{
|
||||
Mantle();
|
||||
return;
|
||||
}
|
||||
|
||||
// if (_grounded.Active || _coyoteEnabled.Active)
|
||||
// {
|
||||
// if (_empowerOn.Active && CanPerformEmpoweredAction())
|
||||
// {
|
||||
// PerformEmpoweredAction();
|
||||
// PerformJump(JumpTypes.JumpFromDash);
|
||||
// _playerState.SendEvent("megajump");
|
||||
// }
|
||||
// }
|
||||
// else if (_doubleJumpEnabled.Active)
|
||||
// if (_empowerOn.Active && CanPerformEmpoweredAction())
|
||||
// {
|
||||
// PerformEmpoweredAction();
|
||||
// PerformJump(JumpTypes.JumpFromDash);
|
||||
// _playerState.SendEvent("megajump");
|
||||
// }
|
||||
// else
|
||||
// PerformJump(JumpTypes.DoubleJump);
|
||||
// else if (_onWall.Active)
|
||||
// JumpFromWall(_empowerOn.Active);
|
||||
|
||||
_playerState.SendEvent("jump");
|
||||
}
|
||||
|
||||
public void OnInputJumpOngoing()
|
||||
{
|
||||
}
|
||||
|
||||
public void OnInputJumpEnded()
|
||||
{
|
||||
_playerState.SendEvent("jump_ended");
|
||||
}
|
||||
|
||||
private int _framesSinceJumpAtApex = 0;
|
||||
public void OnSimpleJumpStarted()
|
||||
{
|
||||
_framesSinceJumpAtApex = 0;
|
||||
|
||||
Velocity = new Vector3(
|
||||
x: Velocity.X,
|
||||
y: SimpleJumpStartVelocity,
|
||||
z: Velocity.Z);
|
||||
}
|
||||
|
||||
public void HandleSimpleJump(float delta)
|
||||
{
|
||||
// Hang time at the top of the jump
|
||||
if (Velocity.Y <= Mathf.Epsilon)
|
||||
{
|
||||
_framesSinceJumpAtApex++;
|
||||
Velocity = new Vector3(
|
||||
x: Velocity.X,
|
||||
y: 0,
|
||||
z: Velocity.Z);
|
||||
}
|
||||
|
||||
// Cancel gravity on jump apex
|
||||
var gravity = CalculateGravityForce() / GravityLesseningFactorUpward;
|
||||
var isAtApex = _framesSinceJumpAtApex > 0;
|
||||
if (isAtApex)
|
||||
{
|
||||
gravity = 0;
|
||||
}
|
||||
// Update velocity accordingly
|
||||
var newVerticalSpeed = Velocity.Y - gravity * delta;
|
||||
Velocity = new Vector3(
|
||||
x: Velocity.X,
|
||||
y: newVerticalSpeed,
|
||||
z: Velocity.Z);
|
||||
|
||||
|
||||
// Move back to Airborne state management when starting to go down again
|
||||
if (_framesSinceJumpAtApex > HangTimeInFrames)
|
||||
_playerState.SendEvent("jump_ended");
|
||||
}
|
||||
|
||||
public void OnSimpleJumpEnded()
|
||||
{
|
||||
}
|
||||
|
||||
public void PowerRecharging(float delta)
|
||||
{
|
||||
var progress = (float) (_dashCooldownTimer.TimeLeft / _dashCooldownTimer.WaitTime);
|
||||
DashCooldownIndicator.SetSize(new Vector2(100 * progress, 10));
|
||||
var progress = (float) (_powerCooldownTimer.TimeLeft / _powerCooldownTimer.WaitTime);
|
||||
PowerCooldownIndicator.SetSize(new Vector2(100 * progress, 10));
|
||||
}
|
||||
|
||||
public void StartDashCooldown()
|
||||
public void StartPowerCooldown()
|
||||
{
|
||||
_dashCooldownTimer.Start();
|
||||
DashCooldownIndicator.Visible = true;
|
||||
_powerCooldownTimer.Start();
|
||||
PowerCooldownIndicator.Visible = true;
|
||||
}
|
||||
|
||||
public void StopDashCooldown()
|
||||
public void StopPowerCooldown()
|
||||
{
|
||||
_dashCooldownTimer.Stop();
|
||||
DashCooldownIndicator.Visible = false;
|
||||
_powerCooldownTimer.Stop();
|
||||
PowerCooldownIndicator.Visible = false;
|
||||
}
|
||||
|
||||
public void DashCooldownExpired()
|
||||
public void PowerCooldownExpired()
|
||||
{
|
||||
EmpoweredActionsLeft += 1;
|
||||
var eventToSend = EmpoweredActionsLeft == MaxNumberOfDashActions ? "fully_charged" : "recharge";
|
||||
@ -372,38 +480,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
OnWeaponThrown();
|
||||
}
|
||||
}
|
||||
public void OnInputJumpPressed()
|
||||
{
|
||||
if (CanMantle())
|
||||
{
|
||||
Mantle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_grounded.Active || _coyoteEnabled.Active)
|
||||
if (_empowerOn.Active && CanPerformEmpoweredAction())
|
||||
{
|
||||
PerformEmpoweredAction();
|
||||
PerformJump(JumpTypes.JumpFromDash);
|
||||
_playerState.SendEvent("megajump");
|
||||
}
|
||||
else
|
||||
PerformJump(JumpTypes.SimpleJump);
|
||||
else if (_doubleJumpEnabled.Active)
|
||||
if (_empowerOn.Active && CanPerformEmpoweredAction())
|
||||
{
|
||||
PerformEmpoweredAction();
|
||||
PerformJump(JumpTypes.JumpFromDash);
|
||||
_playerState.SendEvent("megajump");
|
||||
}
|
||||
else
|
||||
PerformJump(JumpTypes.DoubleJump);
|
||||
else if (_onWall.Active)
|
||||
JumpFromWall(_empowerOn.Active);
|
||||
|
||||
_playerState.SendEvent("jump");
|
||||
|
||||
}
|
||||
public void OnInputDashPressed()
|
||||
{
|
||||
_playerState.SendEvent("dash");
|
||||
@ -452,15 +528,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
// Stateful logic /////////
|
||||
///////////////////////////
|
||||
|
||||
// Simple states
|
||||
public void OnGrounded()
|
||||
{
|
||||
RestoreEmpoweredActions();
|
||||
}
|
||||
|
||||
private void RestoreEmpoweredActions()
|
||||
{
|
||||
// EmpoweredActionsLeft = MaxNumberOfDashActions;
|
||||
_isWallJumpAvailable = true;
|
||||
}
|
||||
|
||||
@ -508,13 +577,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
var jumpVector = (effectiveJumpDirection.Normalized() + Vector3.Up).Normalized();
|
||||
if (jumpType == JumpTypes.DoubleJump)
|
||||
_canDash = false;
|
||||
|
||||
// var proportionOfTimeGone = _timeAfterDashingTimer.TimeLeft / _timeAfterDashingTimer.WaitTime;
|
||||
// var actualBoost = 1 + MaxJumpBoostAfterDashing * proportionOfTimeGone;
|
||||
// var makeItDouble = actualBoost > 1;
|
||||
// if (makeItDouble && jumpType == MoveSystem.JumpTypes.SimpleJump)
|
||||
// jumpType = MoveSystem.JumpTypes.DoubleJump; // convert simple jump to double if done right after a dash
|
||||
// _timeAfterDashingTimer.Stop();
|
||||
|
||||
bool doesCapsuleHaveCrouchingHeight = CapsuleCollider.IsCrouchingHeight();
|
||||
bool isPlayerDead = HealthSystem.IsDead();
|
||||
@ -668,8 +730,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
|
||||
// Weapon planted anywhere else
|
||||
_playerState.SendEvent("dash_ended");
|
||||
if (isOnFloorCustom())
|
||||
RestoreEmpoweredActions(); // Make sure to restore actions if we're still on the ground
|
||||
}
|
||||
public void OnWeaponThrown()
|
||||
{
|
||||
@ -858,7 +918,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
IsCapsuleHeightLessThanNormal = CapsuleCollider.IsCapsuleHeightLessThanNormal(),
|
||||
CurrentSpeedGreaterThanWalkSpeed = false,
|
||||
BetweenCrouchingAndNormalHeight = CapsuleCollider.IsBetweenCrouchingAndNormalHeight(),
|
||||
Delta = (float)delta
|
||||
Delta = delta
|
||||
};
|
||||
StairsSystem.SlideCameraSmoothBackToOrigin(slideCameraParams);
|
||||
}
|
||||
@ -876,7 +936,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
FieldOfView.FovParameters fovParams = new FieldOfView.FovParameters
|
||||
{
|
||||
IsCrouchingHeight = CapsuleCollider.IsCrouchingHeight(),
|
||||
Delta = (float)delta,
|
||||
Delta = delta,
|
||||
SprintSpeed = WalkSpeed,
|
||||
Velocity = Velocity
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ warnings/check_invalid_track_paths=false
|
||||
[application]
|
||||
|
||||
config/name="Movement tests"
|
||||
run/main_scene="uid://dwo50456dv6va"
|
||||
run/main_scene="uid://pk8ypa04qy6x"
|
||||
config/features=PackedStringArray("4.4", "C#", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
@ -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="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="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://55b0dsvioj08" path="res://systems/inputs/base_mode/jump_pressed.tres" id="25_si4d4"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vkvga"]
|
||||
script = ExtResource("4_1rw8g")
|
||||
@ -183,31 +184,6 @@ script = ExtResource("1_qmhk6")
|
||||
action = ExtResource("16_li5ak")
|
||||
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_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_cqc4k"]
|
||||
script = ExtResource("10_cvxqo")
|
||||
axis = 4
|
||||
@ -233,6 +209,31 @@ action = ExtResource("16_rvpjj")
|
||||
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_bkx7d")])
|
||||
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"]
|
||||
script = ExtResource("10_cvxqo")
|
||||
axis = 5
|
||||
@ -281,15 +282,36 @@ script = ExtResource("1_qmhk6")
|
||||
action = ExtResource("18_vibkn")
|
||||
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")
|
||||
button = 0
|
||||
joy_index = -1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_j3mg7"]
|
||||
[sub_resource type="Resource" id="Resource_6pxii"]
|
||||
script = ExtResource("15_fykw6")
|
||||
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"]
|
||||
script = ExtResource("3_yp12v")
|
||||
override_action_settings = false
|
||||
@ -298,7 +320,7 @@ display_name = ""
|
||||
display_category = ""
|
||||
input = SubResource("Resource_oapce")
|
||||
modifiers = Array[ExtResource("5_0qat1")]([])
|
||||
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_j3mg7")])
|
||||
triggers = Array[ExtResource("8_2tfaw")]([])
|
||||
metadata/_guide_triggers_collapsed = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_xt1x5"]
|
||||
@ -382,5 +404,5 @@ input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_v2ywt")])
|
||||
[resource]
|
||||
script = ExtResource("23_llfhp")
|
||||
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"
|
||||
|
14
systems/inputs/base_mode/jump_pressed.tres
Normal file
14
systems/inputs/base_mode/jump_pressed.tres
Normal 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"
|
@ -10,13 +10,17 @@ class_name InputController
|
||||
@export var rotate_floorplane:GUIDEAction
|
||||
|
||||
@export_group("Trigger actions")
|
||||
@export_subgroup("Aim")
|
||||
@export var aim_down:GUIDEAction
|
||||
@export var aim_pressed: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_released:GUIDEAction
|
||||
@export var aim_canceled:GUIDEAction
|
||||
@export var jump:GUIDEAction
|
||||
@export var hit:GUIDEAction
|
||||
@export var dash:GUIDEAction
|
||||
@export var throw:GUIDEAction
|
||||
@ -25,13 +29,19 @@ signal input_move(value: Vector3)
|
||||
signal input_rotate_y(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_down
|
||||
signal input_aim_released
|
||||
|
||||
signal input_empower_down
|
||||
signal input_empower_released
|
||||
signal input_aim_canceled
|
||||
signal input_jump
|
||||
|
||||
signal input_hit
|
||||
signal input_dash
|
||||
signal input_throw
|
||||
@ -45,7 +55,11 @@ func _ready() -> void:
|
||||
empower_down.triggered.connect(on_input_empower_down)
|
||||
empower_released.triggered.connect(on_input_empower_released)
|
||||
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)
|
||||
dash.triggered.connect(on_input_dash)
|
||||
throw.triggered.connect(on_input_throw)
|
||||
@ -59,8 +73,14 @@ func on_input_throw():
|
||||
func on_input_hit():
|
||||
input_hit.emit()
|
||||
|
||||
func on_input_jump():
|
||||
input_jump.emit()
|
||||
func on_input_jump_started():
|
||||
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():
|
||||
input_aim_down.emit()
|
||||
|
5
systems/move/simple_jump.tres
Normal file
5
systems/move/simple_jump.tres
Normal 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
|
Reference in New Issue
Block a user