added some more signals for attack hit, enemy and player controllers turn done, commander enemy death, better enemy movement and turn changing, implemented an rng, added functions to grid and gridmarkers to allow for easier searching of markers, more logic for if a tower commander has actions

This commit is contained in:
2026-06-01 02:28:45 -04:00
parent facb2e227e
commit dd14a8da40
13 changed files with 138 additions and 60 deletions
+21 -21
View File
@@ -14,31 +14,31 @@ public partial class Tower : Sprite2D
public override void _Process(double delta)
{
base._Process(delta);
if (Input.IsActionJustPressed("leftClick"))
if (_commander?._actions > 0)
{
if (_hovered)
if (Input.IsActionJustPressed("leftClick"))
{
_aiming = true;
_commander.LoadAttack();
if (_hovered)
{
_aiming = true;
_commander.LoadAttack();
}
}
if (_aiming)
{
if (Input.IsActionJustReleased("rightClick"))
{
Vector2 offset = (GlobalPosition - GetGlobalMousePosition()) * 500;
_commander.ShootCurrentAttack(offset);
_aiming = false;
}
else if (Input.IsActionJustReleased("leftClick"))
{
_commander.UnloadAttack();
_aiming = false;
}
}
}
if (_aiming)
{
if (Input.IsActionJustReleased("rightClick"))
{
Vector2 offset = (GlobalPosition - GetGlobalMousePosition()) * 500;
_commander.ShootCurrentAttack(offset);
_aiming = false;
}
else if (Input.IsActionJustReleased("leftClick"))
{
_commander.UnloadAttack();
_aiming = false;
}
}
}
public void OnMouseEntered(){