Unit shadows

This commit is contained in:
Anuken 2019-03-28 12:42:04 -04:00
parent c8a15bb7e4
commit d56869aefa
10 changed files with 4428 additions and 4390 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before After
Before After

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 535 KiB

Before After
Before After

View file

@ -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);

View file

@ -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);
}