Various tweaks

This commit is contained in:
Anuken
2020-03-25 23:28:20 -04:00
parent e7ffb0214f
commit f966489298
4 changed files with 6 additions and 11 deletions

View File

@@ -14,6 +14,10 @@ public class FlyingAI extends AIController{
public void update(){ public void update(){
unit.rotation(unit.vel().angle()); unit.rotation(unit.vel().angle());
if(unit.isFlying()){
unit.wobble();
}
if(Units.invalidateTarget(target, unit.team(), unit.x(), unit.y())){ if(Units.invalidateTarget(target, unit.team(), unit.x(), unit.y())){
target = null; target = null;
} }

View File

@@ -40,11 +40,6 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector
Tmp.v1.set(t).sub(vel).limit(acceleration * vector.len()); //delta vector Tmp.v1.set(t).sub(vel).limit(acceleration * vector.len()); //delta vector
vel.add(Tmp.v1); vel.add(Tmp.v1);
//float mag = Tmp.v3.len() * acceleration;
//vel.lerp(t, Tmp.v3.len() * acceleration);
//vel.x = Mathf.approach(vel.x, t.x, mag);
//vel.y = Mathf.approach(vel.y, t.y, mag);
} }
float floorSpeedMultiplier(){ float floorSpeedMultiplier(){
@@ -56,10 +51,6 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
public void update(){ public void update(){
Floor floor = floorOn(); Floor floor = floorOn();
if(isFlying() && !net.client()){
wobble();
}
if(isGrounded() && floor.isLiquid){ if(isGrounded() && floor.isLiquid){
if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= 7f){ if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= 7f){
floor.walkEffect.at(x, y, 0, floor.mapColor); floor.walkEffect.at(x, y, 0, floor.mapColor);

View File

@@ -218,7 +218,7 @@ public class PlanetDialog extends FloatingDialog{
} }
if(sec.hostility >= 0f){ if(sec.hostility >= 0f){
//drawSelection(sec, Color.scarlet, 0.1f * sec.hostility); drawSelection(sec, Color.scarlet, 0.1f * sec.hostility);
} }
} }

View File

@@ -62,7 +62,7 @@ public class LaunchPad extends StorageBlock{
@Override @Override
public boolean acceptItem(Tilec source, Item item){ public boolean acceptItem(Tilec source, Item item){
return item.type == ItemType.material && items.total() < itemCapacity; return item.type == ItemType.material && super.acceptItem(source, item);
} }
@Override @Override