Added flyer shadows / Fixed block inventory rebuild spawn / Distributor
This commit is contained in:
@@ -274,6 +274,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
return isLocal ? Float.MAX_VALUE : 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawShadow(){
|
||||
Draw.rect(mech.iconRegion, x + elevation*elevationScale, y - elevation*elevationScale, rotation - 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
if((debug && (!showPlayer || !showUI)) || dead) return;
|
||||
|
||||
@@ -38,6 +38,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
public static final float velocityPercision = 8f;
|
||||
/**Maximum absolute value of a velocity vector component.*/
|
||||
public static final float maxAbsVelocity = 127f/velocityPercision;
|
||||
public static final float elevationScale = 4f;
|
||||
|
||||
private static final Vector2 moveVector = new Vector2();
|
||||
|
||||
@@ -52,6 +53,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
protected Vector2 velocity = new Translator(0f, 0.0001f);
|
||||
protected float hitTime;
|
||||
protected float drownTime;
|
||||
protected float elevation;
|
||||
|
||||
@Override
|
||||
public UnitInventory getInventory() {
|
||||
@@ -225,6 +227,8 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
if(isFlying()) {
|
||||
x += velocity.x / getMass() * Timers.delta();
|
||||
y += velocity.y / getMass() * Timers.delta();
|
||||
|
||||
elevation = Mathf.lerpDelta(elevation, tile.elevation, 0.04f);
|
||||
}else{
|
||||
boolean onLiquid = floor.isLiquid;
|
||||
|
||||
@@ -299,6 +303,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
|
||||
public void drawUnder(){}
|
||||
public void drawOver(){}
|
||||
public void drawShadow(){}
|
||||
|
||||
public void drawView(){
|
||||
Fill.circle(x, y, getViewDistance());
|
||||
|
||||
@@ -32,6 +32,11 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawShadow(){
|
||||
Draw.rect(type.region, x + elevation*elevationScale, y - elevation*elevationScale, rotation - 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarriableTrait getCarry() {
|
||||
return carrying;
|
||||
|
||||
Reference in New Issue
Block a user