feat: removed crouch and added a UI for available jumps
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 3m40s

This commit is contained in:
2025-07-06 15:11:25 +02:00
parent ef16d6c83f
commit e4880d42f9
5 changed files with 81 additions and 20 deletions

View File

@ -23,6 +23,7 @@ public partial class PlayerController : CharacterBody3D
public Node3D WeaponRoot;
public WeaponSystem WeaponSystem;
public WallHugSystem WallHugSystem;
public PlayerUi PlayerUi;
private bool _movementEnabled = true;
@ -52,9 +53,18 @@ public partial class PlayerController : CharacterBody3D
[Export(PropertyHint.Range, "0,5,1,or_greater")]
public int MaxNumberOfDashActions { get; set; } = 1;
public int DashActionsLeft { get; set; }
private int _dashActionsLeft;
public int DashActionsLeft
{
get => _dashActionsLeft;
set
{
_dashActionsLeft = value;
PlayerUi.SetNumberOfDashesLeft(value);
}
}
private bool _isWallJumpAvailable = true;
private StateChart _playerState;
@ -87,6 +97,7 @@ public partial class PlayerController : CharacterBody3D
// General use stuff
TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
PlayerUi = GetNode<PlayerUi>("UI");
// Node3D mapNode = GetTree().Root.FindChild("Map", true, false) as Node3D;
// Camera stuff
@ -204,8 +215,8 @@ public partial class PlayerController : CharacterBody3D
_aiming.StateEntered += OnAimingEntered;
_aiming.StateExited += ResetTimeScale;
_crouched.StatePhysicsProcessing += HandleGroundedCrouched;
_standing.StatePhysicsProcessing += HandleGroundedStanding;
/*_crouched.StatePhysicsProcessing += HandleGroundedCrouched;
_standing.StatePhysicsProcessing += HandleGroundedStanding;*/
_grounded.StateEntered += OnGrounded;
_grounded.StatePhysicsProcessing += HandleGrounded;
_airborne.StatePhysicsProcessing += HandleAirborne;
@ -286,16 +297,6 @@ public partial class PlayerController : CharacterBody3D
_isWallJumpAvailable = true;
}
public void OnStanding()
{
}
public void OnCrouched()
{
}
public bool CanPerformDashAction()
{
return DashActionsLeft > 0 && _dashCooldownTimer.IsStopped();
@ -303,7 +304,7 @@ public partial class PlayerController : CharacterBody3D
public void PerformDashAction()
{
_isWallJumpAvailable = true;
_isWallJumpAvailable = true;
_dashCooldownTimer.Start();
DashActionsLeft--;
}