feat: removed crouch and added a UI for available jumps
This commit is contained in:
@ -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--;
|
||||
}
|
||||
|
Reference in New Issue
Block a user