Added cliffs as separate block

This commit is contained in:
Anuken
2020-02-21 23:45:25 -05:00
parent 6871db7155
commit baa0eb1149
14 changed files with 1917 additions and 1800 deletions

View File

@@ -123,7 +123,7 @@ public class Tile implements Position{
}
public boolean isDarkened(){
return block().solid && !block().synthetic() && block().fillsTile;
return block.solid && !block.synthetic() && block.fillsTile;
}
public @NonNull Floor floor(){

View File

@@ -0,0 +1,31 @@
package mindustry.world.blocks;
import arc.graphics.g2d.*;
import arc.util.*;
import mindustry.graphics.*;
import mindustry.world.*;
public class Cliff extends Block{
public Cliff(String name){
super(name);
breakable = alwaysReplace = false;
solid = true;
cacheLayer = CacheLayer.walls;
fillsTile = false;
hasShadow = false;
}
@Override
public void draw(Tile tile){
int r = tile.rotation();
for(int i = 0; i < 4; i++){
if((r & (1 << i)) != 0){
Draw.color(Tmp.c1.set(tile.floor().color).mul(1.3f + (i >= 2 ? -0.4f : 0.3f)));
Draw.rect(region, tile.worldx(), tile.worldy(), i * 90f);
}
}
Draw.color();
}
}