Boss waves, health bars / Better lasers / Bugfixes

This commit is contained in:
Anuken
2019-02-21 13:11:28 -05:00
parent f591403b7d
commit 5b7b50f555
38 changed files with 1483 additions and 1379 deletions
@@ -37,6 +37,7 @@ public class BlockRenderer{
private int iterateidx = 0;
private FrameBuffer shadows = new FrameBuffer(2, 2);
private FrameBuffer fog = new FrameBuffer(2, 2);
private Array<Tile> outArray = new Array<>();
public BlockRenderer(){
@@ -181,6 +182,14 @@ public class BlockRenderer{
if(block.layer2 != null && block.isLayer2(tile)){
addRequest(tile, block.layer2);
}
if(tile.entity != null && tile.entity.power != null && tile.entity.power.links.size > 0){
for(Tile other : block.getPowerConnections(tile, outArray)){
if(other.block().layer == Layer.power){
addRequest(other, Layer.power);
}
}
}
}
}
}
@@ -6,6 +6,7 @@ import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Tmp;
//TODO remove
public class Shapes{
@@ -19,16 +20,16 @@ public class Shapes{
}
public static void laser(String line, String edge, float x, float y, float x2, float y2, float rotation, float scale){
Lines.stroke(12f * scale);
Lines.line(Core.atlas.find(line), x, y, x2, y2, CapStyle.none, 0f);
Lines.stroke(1f);
TextureRegion region = Core.atlas.find(edge);
Draw.rect(Core.atlas.find(edge), x, y, region.getWidth() * Draw.scl, region.getHeight() * scale * Draw.scl, rotation + 180);
Tmp.v1.trns(rotation, 8f * scale * Draw.scl);
Draw.rect(Core.atlas.find(edge), x2, y2, region.getWidth() * Draw.scl, region.getHeight() * scale * Draw.scl, rotation);
Draw.rect(Core.atlas.find(edge), x, y, region.getWidth() * scale * Draw.scl, region.getHeight() * scale * Draw.scl, rotation + 180);
Draw.rect(Core.atlas.find(edge), x2, y2, region.getWidth() * scale * Draw.scl, region.getHeight() * scale * Draw.scl, rotation);
Lines.stroke(12f * scale);
Lines.line(Core.atlas.find(line), x + Tmp.v1.x, y + Tmp.v1.y, x2 - Tmp.v1.x, y2 - Tmp.v1.y, CapStyle.none, 0f);
Lines.stroke(1f);
}
public static void tri(float x, float y, float width, float length, float rotation){