redirection tiles
This commit is contained in:
parent
3fe903f2b8
commit
f3a6f7a05a
27 changed files with 369 additions and 70 deletions
21
scripts/entities/AreaOfEffect.cs
Normal file
21
scripts/entities/AreaOfEffect.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Godot;
|
||||
using Newlon.Systems.Effects;
|
||||
|
||||
namespace Newlon.Components;
|
||||
|
||||
public partial class AreaOfEffect : Area2D
|
||||
{
|
||||
[Export] public Effect givenEffect;
|
||||
public override void _Ready()
|
||||
{
|
||||
AreaEntered += OnAreaEntered;
|
||||
}
|
||||
|
||||
public void OnAreaEntered(Area2D what)
|
||||
{
|
||||
if (what.GetParent() is Entity entity)
|
||||
{
|
||||
entity.GiveEffect(givenEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue