@@ -0,0 +1,1032 @@
+package eco.game;%0A%0A/**%0A * This class samples multiple octaves of open simplex noise, and blends them%0A * together.%0A * %0A * @author phil%0A * %0A */%0A%0Apublic class NoiseSampler %7B%0A%0A%09private static int octaves = 8;%0A%0A%09private static OpenSimplexNoise simplexNoise;%0A%0A%09private static int noiseScale;%0A%0A%09private static float amplitude = 0.5f;%0A%0A%09private static float persistance = 0.5f;%0A%0A%09public static float getNoise(float x, float y) %7B%0A%09%09float%5B%5D noise = new float%5Boctaves%5D;%0A%09%09for (int i = 0; i %3C octaves; i++) %7B%0A%09%09%09noise%5Bi%5D = (float) simplexNoise.eval((x * Math.pow(2, i))%0A%09%09%09%09%09/ noiseScale, (y * Math.pow(2, i)) / noiseScale);%0A%09%09%7D%0A%0A%09%09float result = 0.0f;%0A%09%09float totalAmplitude = 0.0f;%0A%09%09float amp = amplitude;%0A%09%09for (int i = 0; i %3C octaves; i++) %7B%0A%09%09%09totalAmplitude += amp;%0A%09%09%09result += noise%5Bi%5D * amp;%0A%09%09%09amp *= persistance;%0A%09%09%7D%0A%09%09return result / totalAmplitude;%0A%09%7D%0A%0A%09public static void initSimplexNoise(int seed) %7B%0A%09%09simplexNoise = new OpenSimplexNoise(seed);%0A%09%7D%0A%0A%09public static void setNoiseScale(int scale) %7B%0A%09%09noiseScale = scale * 2;%0A%09%7D%0A%0A%7D%0A

Create NoiseSampler.java