From af0bacc46fcbd2318e43392cb484e345b1dc6976 Mon Sep 17 00:00:00 2001 From: Solargale Date: Sat, 11 Apr 2020 05:22:58 -0600 Subject: [PATCH] Made terrain generation fast and low lag --- core/src/com/mygdx/game/Dimension/Chunks.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/com/mygdx/game/Dimension/Chunks.java b/core/src/com/mygdx/game/Dimension/Chunks.java index c6d3c01..b2ec007 100644 --- a/core/src/com/mygdx/game/Dimension/Chunks.java +++ b/core/src/com/mygdx/game/Dimension/Chunks.java @@ -11,6 +11,9 @@ import static com.mygdx.game.Dimension.BlockMaterials.*; import static com.mygdx.game.Restrictions.*; public class Chunks{ + OpenSimplexNoise gen1 = new OpenSimplexNoise(SEED+1); + OpenSimplexNoise gen2 = new OpenSimplexNoise(SEED); + public static void create(){ int i = 10; @@ -90,14 +93,10 @@ public class Chunks{ } public double noise1(double nx, double ny) { - OpenSimplexNoise gen1 = new OpenSimplexNoise(SEED+1); - return gen1.eval(nx, ny)/2 + 0.5; } public double noise2(double nx, double ny) { - OpenSimplexNoise gen2 = new OpenSimplexNoise(SEED); - return gen2.eval(nx, ny)/2 + 0.5; }