Unit shadows
BIN
core/assets-raw/sprites_replacement/effects/circle-shadow.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 308 KiB After Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 531 KiB After Width: | Height: | Size: 535 KiB |
@@ -184,6 +184,8 @@ public class Renderer implements ApplicationListener{
|
|||||||
|
|
||||||
blocks.drawBlocks(Layer.overlay);
|
blocks.drawBlocks(Layer.overlay);
|
||||||
|
|
||||||
|
drawGroundShadows();
|
||||||
|
|
||||||
drawAllTeams(false);
|
drawAllTeams(false);
|
||||||
|
|
||||||
blocks.skipLayer(Layer.turret);
|
blocks.skipLayer(Layer.turret);
|
||||||
@@ -224,6 +226,28 @@ public class Renderer implements ApplicationListener{
|
|||||||
Draw.flush();
|
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(){
|
private void drawFlyerShadows(){
|
||||||
float trnsX = -12, trnsY = -13;
|
float trnsX = -12, trnsY = -13;
|
||||||
Draw.color(0, 0, 0, 0.22f);
|
Draw.color(0, 0, 0, 0.22f);
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
|||||||
if(dead) return;
|
if(dead) return;
|
||||||
|
|
||||||
if(!movement.isZero() && moved && !state.isPaused()){
|
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);
|
baseRotation = Mathf.slerpDelta(baseRotation, movement.angle(), 0.13f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||