Aqua state

This commit is contained in:
Rendo 2025-07-28 05:45:31 +05:00
commit 31ba172123
6 changed files with 48 additions and 36 deletions

View file

@ -16,12 +16,13 @@ public partial class SnipachBehaviour : BaseBehaviour
attackBox.Visible = dragging;
}
public void OnDragEnd()
public void OnDragEnd(bool aborted)
{
if (dragging == false) return;
attackBox.Attack();
dragging = false;
attackBox.Visible = dragging;
if (aborted) return;
attackBox.Attack();
timer.Start();
}
@ -31,6 +32,14 @@ public partial class SnipachBehaviour : BaseBehaviour
{
attackBox.GlobalPosition = (Cursor.GetCursorPosition() / FieldParams.Tile).Ceil() * FieldParams.Tile - new Vector2(20, 14);
}
if (timer.TimeLeft > 0)
{
GetParent<Node2D>().Modulate = Colors.DeepSkyBlue;
}
else
{
GetParent<Node2D>().Modulate = Colors.White;
}
}
}