Even more blocks / Map generator config / Editor fixes
This commit is contained in:
@@ -28,6 +28,8 @@ public class MapGenerator extends Generator{
|
||||
* This amount of enemy spawns is selected randomly from the map.*/
|
||||
public int enemySpawns = -1;
|
||||
|
||||
public boolean distortFloor = false;
|
||||
|
||||
public MapGenerator(String mapName){
|
||||
this.mapName = mapName;
|
||||
}
|
||||
@@ -47,6 +49,12 @@ public class MapGenerator extends Generator{
|
||||
return this;
|
||||
}
|
||||
|
||||
public MapGenerator dist(float distortion, boolean floor){
|
||||
this.distortion = distortion;
|
||||
this.distortFloor = floor;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
map = world.maps.loadInternalMap(mapName);
|
||||
@@ -97,6 +105,10 @@ public class MapGenerator extends Generator{
|
||||
tile.setBlock(tiles[newX][newY].block());
|
||||
}
|
||||
|
||||
if(distortFloor){
|
||||
tile.setFloor(tiles[newX][newY].floor());
|
||||
}
|
||||
|
||||
for(Decoration decor : decorations){
|
||||
if(tile.block() == Blocks.air && tile.floor() == decor.floor && Mathf.chance(decor.chance)){
|
||||
tile.setBlock(decor.wall);
|
||||
|
||||
Reference in New Issue
Block a user