Added island around core generation

This commit is contained in:
Anuken
2018-07-31 21:53:40 -04:00
parent 87846864cc
commit e3d16418a0
2 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,7 @@ public class UnitTypes implements ContentList{
isFlying = true;
drag = 0.01f;
speed = 0.2f;
maxVelocity = 0.6f;
maxVelocity = 0.9f;
ammoCapacity = 0;
range = 70f;
itemCapacity = 70;

View File

@ -1,6 +1,7 @@
package io.anuke.mindustry.maps.generation;
import com.badlogic.gdx.math.GridPoint2;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntArray;
import com.badlogic.gdx.utils.ObjectMap;
@ -231,6 +232,8 @@ public class WorldGenerator{
int x = sectorX * sectorSize + localX + Short.MAX_VALUE;
int y = sectorY * sectorSize + localY + Short.MAX_VALUE;
int coreX = 60, coreY = 60;
Block floor;
Block wall = Blocks.air;
@ -240,6 +243,13 @@ public class WorldGenerator{
double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f
+ sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 920f, x, y);
double dst = Vector2.dst(localX, localY, coreX, coreY);
double lerpDst = 20;
if(dst < lerpDst){
elevation = Mathf.lerp((float)elevation, 0.88f, Mathf.clamp(2*(1f-(float)(dst / lerpDst))));
}
if(elevation < 0.7){
floor = Blocks.deepwater;
}else if(elevation < 0.79){