mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
Face player towards aim direction
This commit is contained in:
parent
8eba34915d
commit
25a9bc1d78
9 changed files with 75 additions and 58 deletions
|
|
@ -98,7 +98,8 @@ public partial class Active : PlayerStateBase
|
|||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
_animationProvider.SetAnimation(Vector2.Zero);
|
||||
_animationProvider.SetAnimationSpeed(Vector2.Zero);
|
||||
//_animationProvider.SetAnimation(Vector2.Zero);
|
||||
_crosshairProvider.Hide();
|
||||
_hitboxSpriteProvider.Hide();
|
||||
|
||||
|
|
@ -147,7 +148,8 @@ public partial class Active : PlayerStateBase
|
|||
}
|
||||
// }
|
||||
|
||||
_animationProvider.SetAnimation(MainObject.Velocity);
|
||||
_animationProvider.SetAnimationSpeed(MainObject.Velocity);
|
||||
_animationProvider.SetAnimation(FacingDirection);
|
||||
|
||||
_crosshairProvider.UpdatePosition(FacingDirection);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,11 +15,12 @@ public partial class Cutscene : PlayerStateBase
|
|||
|
||||
public override void ExitState()
|
||||
{
|
||||
_animationProvider.SetAnimation(Vector2.Zero);
|
||||
_animationProvider.SetAnimationSpeed(Vector2.Zero);
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
{
|
||||
_animationProvider.SetAnimationSpeed(MainObject.Velocity);
|
||||
_animationProvider.SetAnimation(MainObject.Velocity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@ public partial class PlayerStorageModule : Node2D
|
|||
public PlayerFSMProxy Root { get; private set; }
|
||||
public Node2D RootAsNode => Root;
|
||||
public Vector2 FacingDirection { get; set; }
|
||||
public Vector2 AimingDirection { get; set; }
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue