Unit shadows
This commit is contained in:
@@ -184,6 +184,8 @@ public class Renderer implements ApplicationListener{
|
||||
|
||||
blocks.drawBlocks(Layer.overlay);
|
||||
|
||||
drawGroundShadows();
|
||||
|
||||
drawAllTeams(false);
|
||||
|
||||
blocks.skipLayer(Layer.turret);
|
||||
@@ -224,6 +226,28 @@ public class Renderer implements ApplicationListener{
|
||||
Draw.flush();
|
||||
}
|
||||
|
||||
private void drawGroundShadows(){
|
||||
Draw.color(0, 0, 0, 0.4f);
|
||||
float rad = 1.6f;
|
||||
|
||||
Consumer<Unit> draw = u -> {
|
||||
float size = Math.max(u.getIconRegion().getWidth(), u.getIconRegion().getHeight()) * Draw.scl;
|
||||
Draw.rect("circle-shadow", u.x, u.y, size * rad, size * rad);
|
||||
};
|
||||
|
||||
for(EntityGroup<? extends BaseUnit> group : unitGroups){
|
||||
if(!group.isEmpty()){
|
||||
drawAndInterpolate(group, unit -> !unit.isDead(), draw::accept);
|
||||
}
|
||||
}
|
||||
|
||||
if(!playerGroup.isEmpty()){
|
||||
drawAndInterpolate(playerGroup, unit -> !unit.isDead(), draw::accept);
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
private void drawFlyerShadows(){
|
||||
float trnsX = -12, trnsY = -13;
|
||||
Draw.color(0, 0, 0, 0.22f);
|
||||
|
||||
@@ -278,7 +278,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
||||
if(dead) return;
|
||||
|
||||
if(!movement.isZero() && moved && !state.isPaused()){
|
||||
walktime += movement.len() / 1f * getFloorOn().speedMultiplier;
|
||||
walktime += movement.len() * getFloorOn().speedMultiplier * 2f;
|
||||
baseRotation = Mathf.slerpDelta(baseRotation, movement.angle(), 0.13f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user