implemented more code for adding more pegs, but still a lot of work to do on pathfinding, targeting, map etc.

This commit is contained in:
2026-07-02 03:15:15 -04:00
parent 909f466f92
commit cbdca6f3cb
16 changed files with 170 additions and 50 deletions
+24 -1
View File
@@ -9,10 +9,33 @@ public partial class ThrustSpear : PegAction
_category = "attack";
_priority = 1;
_cost = 2;
_range = 0;
_range = 1;
_usesMax = 1;
_usesRemaining = _usesMax;
}
public override Tween CreateAnimation(Peg PEG)
{
Map map = PEG._pegController._playArea._map;
Peg pegTarget = map._addressOccupants[Target(PEG)];
Tween subtween = CreateTween();
subtween.TweenProperty(_image, "visible", true, 0.0f);
subtween.TweenProperty(_image, "rotation", PEG.GetAngleTo(pegTarget.GlobalPosition), 0.0f);
subtween.TweenProperty(_image, "position", pegTarget, 0.5f);
subtween.TweenCallback(Callable.From(() =>
{
pegTarget.ChangeHealth(-2);
_image.Position = Vector2.Zero;
_image.Visible = false;
}));
return subtween;
}
public override Vector2I Target(Peg PEG)
{
return PEG.Goal();
}
}