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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

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)); sim.setSeed(Mathf.random(99999));
pass(tiles, (x, y) -> { 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; 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); noise(tiles, Blocks.darksand, Blocks.duneRocks, 5, 0.7f, 120f, 0.5f);
tech(tiles); 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); //scatter(tiles, Blocks.sandRocks, Blocks.creeptree, 1f);
tiles[endX][endY].setBlock(Blocks.spawn); tiles[endX][endY].setBlock(Blocks.spawn);

View File

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