still some bug fixes to work out but not sure how to duplicate them? starting to work on enemy attacks

This commit is contained in:
2026-06-10 01:57:06 -04:00
parent 86113141bf
commit a96d935ad4
3 changed files with 82 additions and 64 deletions
+7 -1
View File
@@ -9,8 +9,10 @@ public partial class Enemy : StaticBody2D
public delegate void DeathEventHandler(Enemy THIS);
[Signal]
public delegate void ClickedEventHandler(Enemy THIS);
[Signal]
public delegate void RightClickedEventHandler(Enemy THIS);
public bool _hovered = false, _track = false;
public int _damage = 1, _health = 2, _speed, _speedRemaining, _visibilityRange = 4;
public int _damage = 1, _health = 2, _speed, _speedRemaining, _visibilityRange = 4, _hitRange = 1;
public Vector2I _address = -Vector2I.One, _range = Vector2I.Up;
public List<Vector2I> _path = new();
public float _movement = 0;
@@ -30,6 +32,10 @@ public partial class Enemy : StaticBody2D
{
EmitSignal(SignalName.Clicked, this);
}
if (Input.IsActionJustPressed("rightClick"))
{
EmitSignal(SignalName.RightClicked, this);
}
}
}
public override void _PhysicsProcess(double delta)