From: fred-boy Date: Thu, 12 Apr 2018 12:08:38 +0000 (+0700) Subject: More blocks, trees X-Git-Tag: alpha0.1~11 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=daa549056b125bac9dec16f86204a25671916466;p=cavedroid.git More blocks, trees --- diff --git a/android/assets/terrain.png b/android/assets/terrain.png index 821b3e3..11be603 100644 Binary files a/android/assets/terrain.png and b/android/assets/terrain.png differ diff --git a/core/src/ru/deadsoftware/cavecraft/Assets.java b/core/src/ru/deadsoftware/cavecraft/Assets.java index 9d06345..6a99f1d 100644 --- a/core/src/ru/deadsoftware/cavecraft/Assets.java +++ b/core/src/ru/deadsoftware/cavecraft/Assets.java @@ -9,7 +9,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; public class Assets { - public static final int BLOCK_TEXTURES = 9; + public static final int BLOCK_TEXTURES = 18; public static BitmapFont minecraftFont; diff --git a/core/src/ru/deadsoftware/cavecraft/Items.java b/core/src/ru/deadsoftware/cavecraft/Items.java index 2b24741..001ac29 100644 --- a/core/src/ru/deadsoftware/cavecraft/Items.java +++ b/core/src/ru/deadsoftware/cavecraft/Items.java @@ -7,7 +7,7 @@ public class Items { public static ArrayMap BLOCKS = new ArrayMap(); - public static void load() { + public static void loadBlocks() { BLOCKS.put("none", null); BLOCKS.put("stone", new Block(0,0,16,16,Assets.blockTextures[0])); BLOCKS.put("grass", new Block(0,0,16,16,Assets.blockTextures[1])); @@ -18,6 +18,19 @@ public class Items { BLOCKS.put("bedrock", new Block(0,0,16,16,Assets.blockTextures[6])); BLOCKS.put("water", new Block(0,0,16,16,Assets.blockTextures[7],false,true)); BLOCKS.put("lava", new Block(0,0,16,16,Assets.blockTextures[8],false,true)); + BLOCKS.put("sand", new Block(0,0,16,16,Assets.blockTextures[9])); + BLOCKS.put("gravel", new Block(0,0,16,16,Assets.blockTextures[10])); + BLOCKS.put("gold_ore", new Block(0,0,16,16,Assets.blockTextures[11])); + BLOCKS.put("iron_ore", new Block(0,0,16,16,Assets.blockTextures[12])); + BLOCKS.put("coal_ore", new Block(0,0,16,16,Assets.blockTextures[13])); + BLOCKS.put("log", new Block(0,0,16,16,Assets.blockTextures[14])); + BLOCKS.put("leaves", new Block(0,0,16,16,Assets.blockTextures[15])); + BLOCKS.put("sponge", new Block(0,0,16,16,Assets.blockTextures[16])); + BLOCKS.put("glass", new Block(0,0,16,16,Assets.blockTextures[17])); + } + + public static void load() { + loadBlocks(); } } diff --git a/core/src/ru/deadsoftware/cavecraft/game/WorldGen.java b/core/src/ru/deadsoftware/cavecraft/game/WorldGen.java index 6c09cf6..d4635fd 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/WorldGen.java +++ b/core/src/ru/deadsoftware/cavecraft/game/WorldGen.java @@ -29,6 +29,26 @@ public class WorldGen { return res; } + private static void genOak(int x, int y) { + backMap[x][y] = 15; + backMap[x][y-1] = 15; + backMap[x][y-2] = 15; + backMap[x][y-3] = 15; + backMap[x][y-4] = 16; + backMap[x][y-5] = 16; + backMap[x-1][y-3] = 16; + backMap[x-1][y-4] = 16; + backMap[x+1][y-3] = 16; + backMap[x+1][y-4] = 16; + foreMap[x][y-3] = 16; + foreMap[x][y-4] = 16; + foreMap[x][y-5] = 16; + foreMap[x-1][y-3] = 16; + foreMap[x-1][y-4] = 16; + foreMap[x+1][y-3] = 16; + foreMap[x+1][y-4] = 16; + } + static void genWorld(int width, int height) { genWorld(width, height, TimeUtils.millis()); } @@ -57,12 +77,13 @@ public class WorldGen { backMap[x][y] = 7; } } - for (int y = height/2; y2 && x