Fixed tree color

This commit is contained in:
Anuken
2019-04-13 11:01:59 -04:00
parent 816ae84005
commit 89b9501f35
10 changed files with 3 additions and 6 deletions

View File

@@ -79,10 +79,10 @@ public abstract class BasicGenerator extends RandomGenerator{
});
}
public void overlay(Tile[][] tiles, Block floor, Block block, int octaves, float falloff, float scl, float threshold){
public void overlay(Tile[][] tiles, Block floor, Block block, float chance, int octaves, float falloff, float scl, float threshold){
sim.setSeed(Mathf.random(99999));
pass(tiles, (x, y) -> {
if(sim.octaveNoise2D(octaves, falloff, 1f / scl, x, y) > threshold && tiles[x][y].floor() == floor){
if(sim.octaveNoise2D(octaves, falloff, 1f / scl, x, y) > threshold && Mathf.chance(chance) && tiles[x][y].floor() == floor){
ore = block;
}
});

View File

@@ -38,7 +38,7 @@ public class DesertWastesGenerator extends BasicGenerator{
noise(tiles, Blocks.darksand, Blocks.duneRocks, 5, 0.7f, 120f, 0.5f);
tech(tiles);
overlay(tiles, Blocks.sand, Blocks.pebbles, 5, 0.8f, 30f, 0.6f);
overlay(tiles, Blocks.sand, Blocks.pebbles, 0.15f, 5, 0.8f, 30f, 0.62f);
//scatter(tiles, Blocks.sandRocks, Blocks.creeptree, 1f);
tiles[endX][endY].setBlock(Blocks.spawn);

View File

@@ -12,14 +12,11 @@ public class TreeBlock extends Block{
super(name);
solid = true;
layer = Layer.power;
//cacheLayer = CacheLayer.walls;
expanded = true;
}
@Override
public void drawLayer(Tile tile){
Draw.colorl(1f - tile.getRotation() / 4f);
Draw.rect(region, tile.drawx(), tile.drawy(), Mathf.randomSeed(tile.pos(), 0, 4) * 90);
Draw.color();
}
}