summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40312aa)
raw | patch | inline | side by side (parent: 40312aa)
author | fred-boy <fred-boy@protonmail.com> | |
Thu, 12 Apr 2018 12:08:38 +0000 (19:08 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Thu, 12 Apr 2018 12:08:38 +0000 (19:08 +0700) |
index 821b3e37a80a41caa072e27b032627aecd9c14b1..11be603c04fcd1a53fa7ce91fa8363cd4ae2a20f 100644 (file)
Binary files a/android/assets/terrain.png and b/android/assets/terrain.png differ
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 9d06345da9848da026bf0c9bd46d1f40382a8f18..6a99f1d3a60a34fab05ad670b5caf81418193115 100644 (file)
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 2b2474158bb40582a736230d7e756c18477a7a6d..001ac291667a69a55431b1a82f33038a6e3f49dd 100644 (file)
public static ArrayMap<String, Block> BLOCKS = new ArrayMap<String, Block>();
- 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]));
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 6c09cf697bc908f6d69790d5fc68f66c7a92100a..d4635fd158f989307afa57ecd1127fbb94b0dcc6 100644 (file)
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());
}
backMap[x][y] = 7;
}
}
- for (int y = height/2; y<height- hMap[x]; y++) {
+ for (int y = height/4*3; y<height- hMap[x]; y++) {
if (foreMap[x][y]==0){
foreMap[x][y] = 8;
backMap[x][y] = 8;
}
}
+ if (x>2 && x<width-2 && rand.nextInt(100)<5) genOak(x,height-hMap[x]-1);
}
}