Fixed boulder sprites

This commit is contained in:
Anuken
2019-06-20 00:16:22 -04:00
parent c5e0db8de9
commit 478d86677d
21 changed files with 29 additions and 3 deletions

View File

@@ -384,7 +384,7 @@ public class Blocks implements ContentList{
darkMetal = new StaticWall("dark-metal");
pebbles = new OverlayFloor("pebbles");
pebbles = new DoubleOverlayFloor("pebbles");
tendrils = new OverlayFloor("tendrils");

View File

@@ -19,7 +19,7 @@ public class Zones implements ContentList{
@Override
public void load(){
groundZero = new Zone("groundZero", new MapGenerator("groundZero", 1).decor(new Decoration(Blocks.snow, Blocks.snowrock, 0.01))){{
groundZero = new Zone("groundZero", new MapGenerator("groundZero", 1)){{
baseLaunchCost = ItemStack.with(Items.copper, -100);
startingItems = ItemStack.list(Items.copper, 100);
alwaysUnlocked = true;

View File

@@ -58,6 +58,10 @@ public class MapGenerator extends Generator{
return this;
}
{
decor(new Decoration(Blocks.snow, Blocks.snowrock, 0.01), new Decoration(Blocks.ignarock, Blocks.pebbles, 0.03f));
}
@Override
public void init(Loadout loadout){
this.loadout = loadout;
@@ -126,7 +130,9 @@ public class MapGenerator extends Generator{
if(tile.block() == Blocks.air && !(decor.wall instanceof Floor) && tile.floor() == decor.floor && Mathf.chance(decor.chance)){
tile.setBlock(decor.wall);
}else if(tile.floor() == decor.floor && decor.wall instanceof Floor && Mathf.chance(decor.chance)){
}else if(tile.floor() == decor.floor && decor.wall.isOverlay() && Mathf.chance(decor.chance)){
tile.setOverlay(decor.wall);
}else if(tile.floor() == decor.floor && decor.wall.isFloor() && !decor.wall.isOverlay() && Mathf.chance(decor.chance)){
tile.setFloor((Floor)decor.wall);
}
}

View File

@@ -0,0 +1,20 @@
package io.anuke.mindustry.world.blocks;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.world.Tile;
public class DoubleOverlayFloor extends OverlayFloor{
public DoubleOverlayFloor(String name){
super(name);
}
@Override
public void draw(Tile tile){
Draw.colorl(0.4f);
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy() - 0.75f);
Draw.color();
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
}
}