mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Damage actor handler
This commit is contained in:
parent
335f4d5430
commit
4fd31d7988
7 changed files with 100 additions and 4 deletions
|
|
@ -10,6 +10,8 @@ public partial class AnimationHandler : ActorModule
|
|||
|
||||
protected Actor _parent;
|
||||
|
||||
public bool IsDestroyed => _parent.IsDestroyed;
|
||||
|
||||
public override void Init(Actor parent)
|
||||
{
|
||||
_parent = parent;
|
||||
|
|
@ -25,6 +27,8 @@ public partial class AnimationHandler : ActorModule
|
|||
|
||||
public override void Update(double delta)
|
||||
{
|
||||
if (IsDestroyed) return;
|
||||
|
||||
var direction = _parent.FacingDirection; //GetSnappedDirection();
|
||||
|
||||
if (_parent.Velocity.Length() > 0)
|
||||
|
|
@ -38,7 +42,6 @@ public partial class AnimationHandler : ActorModule
|
|||
_animatedSprite.Play("walk_" + DirectionToString(direction));
|
||||
_animatedSprite.SpeedScale = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void PhysicsUpdate(double delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue