Improved approach behavior in formations/logic
This commit is contained in:
@@ -83,4 +83,12 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
|
||||
walked = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approach(Vec2 vector){
|
||||
if(!vector.isZero(0.09f)){
|
||||
//mark walking state when moving in a controlled manner
|
||||
walked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
@Import Team team;
|
||||
@Import int id;
|
||||
@Import @Nullable Tile mineTile;
|
||||
@Import Vec2 vel;
|
||||
|
||||
private UnitController controller;
|
||||
UnitType type;
|
||||
@@ -51,6 +52,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
moveAt(vector, type.accel);
|
||||
}
|
||||
|
||||
public void approach(Vec2 vector){
|
||||
vel.approachDelta(vector, type.accel * realSpeed() * floorSpeedMultiplier());
|
||||
}
|
||||
|
||||
public void aimLook(Position pos){
|
||||
aim(pos);
|
||||
lookAt(pos);
|
||||
|
||||
Reference in New Issue
Block a user