Better cliff sprites
This commit is contained in:
@@ -496,8 +496,24 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
|
||||
protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){
|
||||
if(build != null){
|
||||
int size = build.block.size;
|
||||
build.remove();
|
||||
build = null;
|
||||
|
||||
//update edge entities
|
||||
tileSet.clear();
|
||||
|
||||
for(Point2 edge : Edges.getEdges(size)){
|
||||
Building other = world.build(x + edge.x, y + edge.y);
|
||||
if(other != null){
|
||||
tileSet.add(other);
|
||||
}
|
||||
}
|
||||
|
||||
//update proximity, since multiblock was just removed
|
||||
for(Building t : tileSet){
|
||||
t.updateProximity();
|
||||
}
|
||||
}
|
||||
|
||||
if(block.hasBuilding()){
|
||||
|
||||
@@ -2,11 +2,13 @@ package mindustry.world.blocks.environment;
|
||||
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public class Cliff extends Block{
|
||||
public float size = 11f;
|
||||
public @Load(value = "cliffmask#", length = 256) TextureRegion[] cliffs;
|
||||
|
||||
public Cliff(String name){
|
||||
super(name);
|
||||
@@ -19,15 +21,8 @@ public class Cliff extends Block{
|
||||
|
||||
@Override
|
||||
public void drawBase(Tile tile){
|
||||
|
||||
int r = tile.data;
|
||||
for(int i = 0; i < 8; i++){
|
||||
if((r & (1 << i)) != 0){
|
||||
Draw.color(Tmp.c1.set(tile.floor().mapColor).mul(1.3f + (i >= 4 ? -0.4f : 0.3f)));
|
||||
Draw.rect(region, tile.worldx(), tile.worldy(), size, size, i * 45f);
|
||||
}
|
||||
}
|
||||
|
||||
Draw.color(Tmp.c1.set(tile.floor().mapColor).mul(1.6f));
|
||||
Draw.rect(cliffs[tile.data & 0xff], tile.worldx(), tile.worldy());
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user