updating movement and added a bucket, still some clean up to do on movement. TODO: if enemy becomes stuck, reclculate path.
This commit is contained in:
+10
-1
@@ -21,11 +21,19 @@ public partial class Commander : Sprite2D
|
||||
{
|
||||
_attack.QueueFree();
|
||||
_attack = null;
|
||||
EmitSignal(SignalName.ActionsUp);
|
||||
if (_actions <= 0)
|
||||
{
|
||||
EmitSignal(SignalName.ActionsUp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AttackEnteredBucket()
|
||||
{
|
||||
_actions += (_actions + 1) > _actionsMax ? 0 : 1;
|
||||
}
|
||||
|
||||
public void LoadAttack(Vector2 OFFSET)
|
||||
{
|
||||
if (_attack == null)
|
||||
@@ -34,6 +42,7 @@ public partial class Commander : Sprite2D
|
||||
_attack.Position = OFFSET;
|
||||
_attack._commanderOwner = this;
|
||||
_attack.GravityScale = 0;
|
||||
_attack.BucketEntered += AttackEnteredBucket;
|
||||
AddChild(_attack);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user