Formation tweaks
This commit is contained in:
@@ -17,6 +17,8 @@ abstract class CommanderComp implements Unitc{
|
||||
|
||||
transient @Nullable Formation formation;
|
||||
transient Seq<Unit> controlling = new Seq<>();
|
||||
/** minimum speed of any unit in the formation. */
|
||||
transient float minFormationSpeed;
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
@@ -45,13 +47,15 @@ abstract class CommanderComp implements Unitc{
|
||||
void command(Formation formation, Seq<Unit> units){
|
||||
clearCommand();
|
||||
|
||||
float spacing = 8f;
|
||||
float spacing = hitSize() * 1.7f;
|
||||
minFormationSpeed = type().speed;
|
||||
|
||||
controlling.addAll(units);
|
||||
for(Unit unit : units){
|
||||
FormationAI ai;
|
||||
unit.controller(ai = new FormationAI(base(), formation));
|
||||
spacing = Math.max(spacing, ai.formationSize());
|
||||
minFormationSpeed = Math.min(minFormationSpeed, unit.type().speed);
|
||||
}
|
||||
this.formation = formation;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user