aaaaaaaAAAAAAAAAAAAAAAAAA

This commit is contained in:
Anuken
2021-12-18 23:23:35 -05:00
parent 41b669d6e1
commit 8023ea1d34
14 changed files with 103 additions and 80 deletions
+9 -5
View File
@@ -1,22 +1,26 @@
package mindustry.ai.types;
import arc.math.*;
import arc.math.geom.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
import mindustry.world.blocks.units.UnitAssembler.*;
public class AssemblerAI extends AIController{
public Vec2 targetPos = new Vec2();
public float targetAngle;
@Override
public void updateMovement(){
//TODO
if(!targetPos.isZero()){
moveTo(targetPos, 8f, 11f);
moveTo(targetPos, 1f, 3f);
}
if(unit instanceof BuildingTetherc tether && tether.building() instanceof UnitAssemblerBuild assembler){
unit.lookAt(assembler.getUnitSpawn());
if(unit.within(targetPos, 5f)){
unit.lookAt(targetAngle);
}
}
public boolean inPosition(){
return unit.within(targetPos, 10f) && Angles.within(unit.rotation, targetAngle, 15f);
}
}