From c938382b1332c47e7119f742711960c7cc4c75ca Mon Sep 17 00:00:00 2001 From: fred-boy Date: Sun, 9 Sep 2018 19:38:27 +0700 Subject: [PATCH] Add desert --- .../cavecraft/game/GameRenderer.java | 2 +- .../cavecraft/game/GameWorld.java | 3 +- .../deadsoftware/cavecraft/game/WorldGen.java | 52 +++++++++++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index b528972..58564bf 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -123,7 +123,7 @@ public class GameRenderer extends Renderer { spriteBatch.draw(Assets.creativeInv, x, y); spriteBatch.draw(Assets.creativeScroll, x+156, y+18+(gameProc.creativeScroll*(72/gameProc.maxCreativeScroll))); - for (int i=gameProc.creativeScroll*8; i<(gameProc.creativeScroll+1)*40; i++) { + for (int i=gameProc.creativeScroll*8; i0 && i-3 && t<3) t=0; else t/=Math.abs(t); if (i>width-(max-min)) { @@ -33,6 +37,12 @@ public class WorldGen { return res; } + private static void genCactus(int x, int y) { + foreMap[x][y] = 59; + foreMap[x][y-1] = 59; + foreMap[x][y-2] = 59; + } + private static void genOak(int x, int y) { backMap[x][y] = 15; backMap[x][y-1] = 15; @@ -68,21 +78,42 @@ public class WorldGen { dirtH = 4+rand.nextInt(2); for (int y = height- hMap[x]; y2 && x