More environmental support

This commit is contained in:
Anuken
2021-06-17 14:34:57 -04:00
parent 23ced8d006
commit b77b89abfb
10 changed files with 14 additions and 2 deletions

View File

@@ -16,12 +16,13 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
public void generate(){
int seed = state.rules.sector.planet.id;
int sx = width/2, sy = height/2;
Rand rand = new Rand(seed);
pass((x, y) -> {
floor = Blocks.space;
if(Simplex.noise2d(seed, 5, 0.6f, 1f/ 100f, x, y) + Mathf.dst(x, y, sx, sy) / (float)width / 2f > 0.7f){
floor = Blocks.stone;
if(Simplex.noise2d(seed, 5, 0.5f, 1f / 120f, x, y) - Mathf.dst(x, y, sx, sy) / (width/2f) > 0f){
floor = rand.chance(0.02) ? Blocks.craters : Blocks.stone;
}
});