Spikeweed

This commit is contained in:
Фёдор Веселов 2024-09-25 15:14:00 +05:00
commit b543631c86
5 changed files with 151 additions and 1 deletions

View file

@ -0,0 +1,20 @@
using Godot;
using System;
public partial class SpikeweedBehaviour : Node
{
[Export] private AnimationPlayer _player;
private int _inCount = 0;
public void OnHitboxEntered(Area2D _area)
{
if (_inCount++ == 0)
_player.Play("attack");
}
public void OnHitboxExited(Area2D _area)
{
if (--_inCount == 0)
_player.Play("idle");
}
}