mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 13:25:54 +00:00
FSM Selector with sound
This commit is contained in:
parent
f6d159b9c4
commit
ee09c50dbd
20 changed files with 330 additions and 28 deletions
|
|
@ -28,6 +28,7 @@ public partial class Active : PlayerFSMState
|
|||
private InputProvider _inputProvider;
|
||||
|
||||
[Export] private PlayerDamageReceiver _damageReceiver;
|
||||
[Export] private ActivationProvider _activationProvider;
|
||||
|
||||
private bool _isStrafing;
|
||||
|
||||
|
|
@ -58,6 +59,8 @@ public partial class Active : PlayerFSMState
|
|||
|
||||
_damageReceiver.Init();
|
||||
|
||||
_activationProvider.Init();
|
||||
|
||||
//_weaponProvider = stateMachine.GetNode<PlayerWeaponProvider>("WeaponProvider");
|
||||
//_animationProvider = stateMachine.GetNode<PlayerAnimationProvider>("AnimationProvider");
|
||||
|
||||
|
|
@ -71,6 +74,7 @@ public partial class Active : PlayerFSMState
|
|||
_crosshairProvider.Show();
|
||||
|
||||
_damageReceiver.Enabled = true;
|
||||
_activationProvider.Enabled = true;
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
|
|
@ -80,6 +84,7 @@ public partial class Active : PlayerFSMState
|
|||
_hitboxSpriteProvider.Hide();
|
||||
|
||||
_damageReceiver.Enabled = false;
|
||||
_activationProvider.Enabled = false;
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
@ -117,6 +122,8 @@ public partial class Active : PlayerFSMState
|
|||
_crosshairProvider.UpdatePosition(FacingDirection);
|
||||
|
||||
HandleShoot();
|
||||
|
||||
HandleInteraction();
|
||||
// FindInteractable();
|
||||
|
||||
// _crosshair.Position = CalculateCrosshairPosition();
|
||||
|
|
@ -129,5 +136,8 @@ public partial class Active : PlayerFSMState
|
|||
_weaponProvider.Shoot(this.FacingDirection);
|
||||
}
|
||||
|
||||
|
||||
private void HandleInteraction()
|
||||
{
|
||||
_activationProvider.HandleInteraction();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
29
Scripts/Components/FSM/Player/Controlling.cs
Normal file
29
Scripts/Components/FSM/Player/Controlling.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Player;
|
||||
|
||||
public partial class Controlling : PlayerFSMState
|
||||
{
|
||||
[Export]
|
||||
private PlayerAnimationProvider _animationProvider;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/Player/Controlling.cs.uid
Normal file
1
Scripts/Components/FSM/Player/Controlling.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bwtcgcvfw8urt
|
||||
29
Scripts/Components/FSM/Player/Cutscene.cs
Normal file
29
Scripts/Components/FSM/Player/Cutscene.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Player;
|
||||
|
||||
public partial class Cutscene : PlayerFSMState
|
||||
{
|
||||
[Export]
|
||||
private PlayerAnimationProvider _animationProvider;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/Player/Cutscene.cs.uid
Normal file
1
Scripts/Components/FSM/Player/Cutscene.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dn2rrgw3e027b
|
||||
|
|
@ -6,19 +6,28 @@ public partial class Dead : PlayerFSMState
|
|||
{
|
||||
[Export]
|
||||
private PlayerAnimationProvider _animationProvider;
|
||||
|
||||
public override void Init(ActorStateMachine stateMachine)
|
||||
{
|
||||
base.Init(stateMachine);
|
||||
// get hud?
|
||||
|
||||
}
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
_animationProvider.PlayDeathAnimation();
|
||||
// show game over
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
|
||||
// Hide game over
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
// wait for button
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
29
Scripts/Components/FSM/Player/Teleporting.cs
Normal file
29
Scripts/Components/FSM/Player/Teleporting.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Player;
|
||||
|
||||
public partial class Teleporting : PlayerFSMState
|
||||
{
|
||||
[Export]
|
||||
private PlayerAnimationProvider _animationProvider;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/Player/Teleporting.cs.uid
Normal file
1
Scripts/Components/FSM/Player/Teleporting.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b0khv2fcrgm6t
|
||||
Loading…
Add table
Add a link
Reference in a new issue