Animations improved
This commit is contained in:
parent
c89d93cf24
commit
ad18793543
35 changed files with 430 additions and 465 deletions
|
|
@ -2,18 +2,15 @@ using Godot;
|
|||
|
||||
namespace Newlon.Components.Plants.Behaviours;
|
||||
|
||||
public partial class PotatomineBehaviour : Node
|
||||
public partial class PotatomineBehaviour : BaseBehaviour
|
||||
{
|
||||
[Export] private AnimationPlayer _player;
|
||||
[Export] private Area2D _hitbox;
|
||||
[Export] private CollisionShape2D _unprimedShape;
|
||||
[Export] private CollisionShape2D _primedShape;
|
||||
|
||||
private bool _primed = false;
|
||||
public void Prime()
|
||||
{
|
||||
_player.Play("prime");
|
||||
_player.Queue("idle_primed");
|
||||
_tree.Set("parameters/conditions/primed",true);
|
||||
|
||||
_hitbox.Monitorable = false;
|
||||
|
||||
|
|
@ -25,6 +22,7 @@ public partial class PotatomineBehaviour : Node
|
|||
public void OnAreaEntered(Area2D area)
|
||||
{
|
||||
if (_primed == false) return;
|
||||
GetNode<Timer>("ExplosionTimer").Start();
|
||||
_tree.Set("parameters/conditions/explode",true);
|
||||
_primed = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue