minor changes, next step is to add 2-3 friendly pegs, 2 neutral pegs, 2 hostile pegs, 2 buildings and all associated actions for these additions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class BasicMovement : PegAction
|
||||
{
|
||||
@@ -17,11 +18,15 @@ public partial class BasicMovement : PegAction
|
||||
|
||||
public override Tween CreateAnimation(Peg PEG)
|
||||
{
|
||||
GD.Print(PEG._address);
|
||||
PegController pegController = PEG._pegController;
|
||||
Map map = pegController._playArea._map;
|
||||
Vector2I cell = PEG._path[0];
|
||||
|
||||
Tween subtween = CreateTween();
|
||||
subtween.TweenProperty(PEG, "global_position", map.GetCellPositionFromAddress(cell), 0.25f);
|
||||
Vector2 target = map.GetCellPositionFromAddress(cell);
|
||||
|
||||
subtween.TweenProperty(PEG, "global_position", target, 0.25f);
|
||||
PEG._path.RemoveAt(0);
|
||||
return subtween;
|
||||
}
|
||||
@@ -36,7 +41,9 @@ public partial class BasicMovement : PegAction
|
||||
return;
|
||||
}
|
||||
Vector2I cell = path[0];
|
||||
|
||||
map.SetCellPeg(cell, PEG);
|
||||
PEG._path.Add(cell);
|
||||
}
|
||||
|
||||
public override bool MeetsCriteria(Peg PEG)
|
||||
@@ -44,4 +51,6 @@ public partial class BasicMovement : PegAction
|
||||
return base.MeetsCriteria(PEG) && PEG._address.Y > PEG._pegController._playArea._map._firstOpenRow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user