DEADSOFTWARE

Return tools
authorfred-boy <fredboy@protonmail.com>
Fri, 27 Sep 2019 13:16:21 +0000 (20:16 +0700)
committerfred-boy <fredboy@protonmail.com>
Sun, 29 Sep 2019 04:39:17 +0000 (11:39 +0700)
98 files changed:
android/assets/game_items.json
android/assets/textures/blocks/bed_l.png [moved from android/assets/textures/bed_l.png with 100% similarity]
android/assets/textures/blocks/bed_r.png [moved from android/assets/textures/bed_r.png with 100% similarity]
android/assets/textures/blocks/bedrock.png [moved from android/assets/textures/bedrock.png with 100% similarity]
android/assets/textures/blocks/bookshelf.png [moved from android/assets/textures/bookshelf.png with 100% similarity]
android/assets/textures/blocks/brick_slab.png [moved from android/assets/textures/brick_slab.png with 100% similarity]
android/assets/textures/blocks/bricks.png [moved from android/assets/textures/bricks.png with 100% similarity]
android/assets/textures/blocks/cactus.png [moved from android/assets/textures/cactus.png with 100% similarity]
android/assets/textures/blocks/cake.png [moved from android/assets/textures/cake.png with 100% similarity]
android/assets/textures/blocks/clay.png [moved from android/assets/textures/clay.png with 100% similarity]
android/assets/textures/blocks/coal_block.png [moved from android/assets/textures/coal_block.png with 100% similarity]
android/assets/textures/blocks/coal_ore.png [moved from android/assets/textures/coal_ore.png with 100% similarity]
android/assets/textures/blocks/cobblestone.png [moved from android/assets/textures/cobblestone.png with 100% similarity]
android/assets/textures/blocks/cobblestone_mossy.png [moved from android/assets/textures/cobblestone_mossy.png with 100% similarity]
android/assets/textures/blocks/cobblestone_slab.png [moved from android/assets/textures/cobblestone_slab.png with 100% similarity]
android/assets/textures/blocks/crafting_table.png [moved from android/assets/textures/crafting_table.png with 100% similarity]
android/assets/textures/blocks/dandelion.png [moved from android/assets/textures/dandelion.png with 100% similarity]
android/assets/textures/blocks/deadbush.png [moved from android/assets/textures/deadbush.png with 100% similarity]
android/assets/textures/blocks/diamond_block.png [moved from android/assets/textures/diamond_block.png with 100% similarity]
android/assets/textures/blocks/diamond_ore.png [moved from android/assets/textures/diamond_ore.png with 100% similarity]
android/assets/textures/blocks/dirt.png [moved from android/assets/textures/dirt.png with 100% similarity]
android/assets/textures/blocks/double_stone_slab.png [moved from android/assets/textures/double_stone_slab.png with 100% similarity]
android/assets/textures/blocks/furnace_off.png [moved from android/assets/textures/furnace_off.png with 100% similarity]
android/assets/textures/blocks/furnace_on.png [moved from android/assets/textures/furnace_on.png with 100% similarity]
android/assets/textures/blocks/glass.png [moved from android/assets/textures/glass.png with 100% similarity]
android/assets/textures/blocks/gold_block.png [moved from android/assets/textures/gold_block.png with 100% similarity]
android/assets/textures/blocks/gold_ore.png [moved from android/assets/textures/gold_ore.png with 100% similarity]
android/assets/textures/blocks/grass.png [moved from android/assets/textures/grass.png with 100% similarity]
android/assets/textures/blocks/gravel.png [moved from android/assets/textures/gravel.png with 100% similarity]
android/assets/textures/blocks/iron_bars.png [moved from android/assets/textures/iron_bars.png with 100% similarity]
android/assets/textures/blocks/iron_block.png [moved from android/assets/textures/iron_block.png with 100% similarity]
android/assets/textures/blocks/iron_ore.png [moved from android/assets/textures/iron_ore.png with 100% similarity]
android/assets/textures/blocks/ladder.png [moved from android/assets/textures/ladder.png with 100% similarity]
android/assets/textures/blocks/lapis_block.png [moved from android/assets/textures/lapis_block.png with 100% similarity]
android/assets/textures/blocks/lapis_ore.png [moved from android/assets/textures/lapis_ore.png with 100% similarity]
android/assets/textures/blocks/lava.png [moved from android/assets/textures/lava.png with 100% similarity]
android/assets/textures/blocks/lava_12.png [moved from android/assets/textures/lava_12.png with 100% similarity]
android/assets/textures/blocks/lava_16.png [moved from android/assets/textures/lava_16.png with 100% similarity]
android/assets/textures/blocks/lava_4.png [moved from android/assets/textures/lava_4.png with 100% similarity]
android/assets/textures/blocks/lava_8.png [moved from android/assets/textures/lava_8.png with 100% similarity]
android/assets/textures/blocks/leaves.png [moved from android/assets/textures/leaves.png with 100% similarity]
android/assets/textures/blocks/log.png [moved from android/assets/textures/log.png with 100% similarity]
android/assets/textures/blocks/mushroom_brown.png [moved from android/assets/textures/mushroom_brown.png with 100% similarity]
android/assets/textures/blocks/mushroom_red.png [moved from android/assets/textures/mushroom_red.png with 100% similarity]
android/assets/textures/blocks/noteblock.png [moved from android/assets/textures/noteblock.png with 100% similarity]
android/assets/textures/blocks/obsidian.png [moved from android/assets/textures/obsidian.png with 100% similarity]
android/assets/textures/blocks/planks.png [moved from android/assets/textures/planks.png with 100% similarity]
android/assets/textures/blocks/rose.png [moved from android/assets/textures/rose.png with 100% similarity]
android/assets/textures/blocks/sand.png [moved from android/assets/textures/sand.png with 100% similarity]
android/assets/textures/blocks/sandstone.png [moved from android/assets/textures/sandstone.png with 100% similarity]
android/assets/textures/blocks/sandstone_slab.png [moved from android/assets/textures/sandstone_slab.png with 100% similarity]
android/assets/textures/blocks/sapling.png [moved from android/assets/textures/sapling.png with 100% similarity]
android/assets/textures/blocks/sponge.png [moved from android/assets/textures/sponge.png with 100% similarity]
android/assets/textures/blocks/sponge_wet.png [moved from android/assets/textures/sponge_wet.png with 100% similarity]
android/assets/textures/blocks/stone.png [moved from android/assets/textures/stone.png with 100% similarity]
android/assets/textures/blocks/stone_slab.png [moved from android/assets/textures/stone_slab.png with 100% similarity]
android/assets/textures/blocks/stonebrick.png [moved from android/assets/textures/stonebrick.png with 100% similarity]
android/assets/textures/blocks/stonebrick_slab.png [moved from android/assets/textures/stonebrick_slab.png with 100% similarity]
android/assets/textures/blocks/tallgrass.png [moved from android/assets/textures/tallgrass.png with 100% similarity]
android/assets/textures/blocks/water.png [moved from android/assets/textures/water.png with 100% similarity]
android/assets/textures/blocks/water_12.png [moved from android/assets/textures/water_12.png with 100% similarity]
android/assets/textures/blocks/water_16.png [moved from android/assets/textures/water_16.png with 100% similarity]
android/assets/textures/blocks/water_4.png [moved from android/assets/textures/water_4.png with 100% similarity]
android/assets/textures/blocks/water_8.png [moved from android/assets/textures/water_8.png with 100% similarity]
android/assets/textures/blocks/web.png [moved from android/assets/textures/web.png with 100% similarity]
android/assets/textures/blocks/wooden_slab.png [moved from android/assets/textures/wooden_slab.png with 100% similarity]
android/assets/textures/blocks/wool.png [moved from android/assets/textures/wool.png with 100% similarity]
android/assets/textures/blocks/wool_black.png [moved from android/assets/textures/wool_black.png with 100% similarity]
android/assets/textures/blocks/wool_blue.png [moved from android/assets/textures/wool_blue.png with 100% similarity]
android/assets/textures/blocks/wool_brown.png [moved from android/assets/textures/wool_brown.png with 100% similarity]
android/assets/textures/blocks/wool_cyan.png [moved from android/assets/textures/wool_cyan.png with 100% similarity]
android/assets/textures/blocks/wool_gray.png [moved from android/assets/textures/wool_gray.png with 100% similarity]
android/assets/textures/blocks/wool_green.png [moved from android/assets/textures/wool_green.png with 100% similarity]
android/assets/textures/blocks/wool_lightblue.png [moved from android/assets/textures/wool_lightblue.png with 100% similarity]
android/assets/textures/blocks/wool_lightgray.png [moved from android/assets/textures/wool_lightgray.png with 100% similarity]
android/assets/textures/blocks/wool_lime.png [moved from android/assets/textures/wool_lime.png with 100% similarity]
android/assets/textures/blocks/wool_magenta.png [moved from android/assets/textures/wool_magenta.png with 100% similarity]
android/assets/textures/blocks/wool_orange.png [moved from android/assets/textures/wool_orange.png with 100% similarity]
android/assets/textures/blocks/wool_pink.png [moved from android/assets/textures/wool_pink.png with 100% similarity]
android/assets/textures/blocks/wool_purple.png [moved from android/assets/textures/wool_purple.png with 100% similarity]
android/assets/textures/blocks/wool_red.png [moved from android/assets/textures/wool_red.png with 100% similarity]
android/assets/textures/blocks/wool_yellow.png [moved from android/assets/textures/wool_yellow.png with 100% similarity]
android/assets/textures/items/bucket_empty.png [new file with mode: 0644]
android/assets/textures/items/bucket_lava.png [new file with mode: 0644]
android/assets/textures/items/bucket_milk.png [new file with mode: 0644]
android/assets/textures/items/bucket_water.png [new file with mode: 0644]
android/assets/textures/items/diamond_shovel.png [new file with mode: 0644]
android/assets/textures/items/diamond_sword.png [new file with mode: 0644]
android/assets/textures/items/gold_shovel.png [new file with mode: 0644]
android/assets/textures/items/gold_sword.png [new file with mode: 0644]
android/assets/textures/items/iron_shovel.png [new file with mode: 0644]
android/assets/textures/items/iron_sword.png [new file with mode: 0644]
android/assets/textures/items/stone_shovel.png [new file with mode: 0644]
android/assets/textures/items/stone_sword.png [new file with mode: 0644]
android/assets/textures/items/wood_shovel.png [new file with mode: 0644]
android/assets/textures/items/wood_sword.png [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/game/GameItems.java
core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java

index 0bc31cc7411024dc7e1e216040a77f6b1fe543e5..b53908256af6d11e54a70798efb862dd9c9d39e3 100644 (file)
     "obsidian": {
       "name": "Obsidian",
       "type": "block"
+    },
+    "wood_sword": {
+      "name": "Wooden Sword",
+      "type": "tool"
+    },
+    "stone_sword": {
+      "name": "Stone Sword",
+      "type": "tool"
+    },
+    "iron_sword": {
+      "name": "Iron Sword",
+      "type": "tool"
+    },
+    "diamond_sword": {
+      "name": "Diamond Sword",
+      "type": "tool"
+    },
+    "gold_sword": {
+      "name": "Golden Sword",
+      "type": "tool"
+    },
+    "wood_shovel": {
+      "name": "Wooden Shovel",
+      "type": "tool"
+    },
+    "stone_shovel": {
+      "name": "Stone Shovel",
+      "type": "tool"
+    },
+    "iron_shovel": {
+      "name": "Iron Shovel",
+      "type": "tool"
+    },
+    "diamond_shovel": {
+      "name": "Diamond Shovel",
+      "type": "tool"
+    },
+    "gold_shovel": {
+      "name": "Golden Shovel",
+      "type": "tool"
+    },
+    "bucket_empty": {
+      "name": "Empty Bucket",
+      "type": "tool"
+    },
+    "bucket_water": {
+      "name": "Water Bucket",
+      "type": "tool"
+    },
+    "bucket_lava": {
+      "name": "Lava Bucket",
+      "type": "tool"
     }
   }
 }
\ No newline at end of file
diff --git a/android/assets/textures/items/bucket_empty.png b/android/assets/textures/items/bucket_empty.png
new file mode 100644 (file)
index 0000000..5afe77b
Binary files /dev/null and b/android/assets/textures/items/bucket_empty.png differ
diff --git a/android/assets/textures/items/bucket_lava.png b/android/assets/textures/items/bucket_lava.png
new file mode 100644 (file)
index 0000000..97b84f8
Binary files /dev/null and b/android/assets/textures/items/bucket_lava.png differ
diff --git a/android/assets/textures/items/bucket_milk.png b/android/assets/textures/items/bucket_milk.png
new file mode 100644 (file)
index 0000000..4208fb6
Binary files /dev/null and b/android/assets/textures/items/bucket_milk.png differ
diff --git a/android/assets/textures/items/bucket_water.png b/android/assets/textures/items/bucket_water.png
new file mode 100644 (file)
index 0000000..d6cb934
Binary files /dev/null and b/android/assets/textures/items/bucket_water.png differ
diff --git a/android/assets/textures/items/diamond_shovel.png b/android/assets/textures/items/diamond_shovel.png
new file mode 100644 (file)
index 0000000..7d50c0c
Binary files /dev/null and b/android/assets/textures/items/diamond_shovel.png differ
diff --git a/android/assets/textures/items/diamond_sword.png b/android/assets/textures/items/diamond_sword.png
new file mode 100644 (file)
index 0000000..344ed9c
Binary files /dev/null and b/android/assets/textures/items/diamond_sword.png differ
diff --git a/android/assets/textures/items/gold_shovel.png b/android/assets/textures/items/gold_shovel.png
new file mode 100644 (file)
index 0000000..e9afbd0
Binary files /dev/null and b/android/assets/textures/items/gold_shovel.png differ
diff --git a/android/assets/textures/items/gold_sword.png b/android/assets/textures/items/gold_sword.png
new file mode 100644 (file)
index 0000000..e6176ec
Binary files /dev/null and b/android/assets/textures/items/gold_sword.png differ
diff --git a/android/assets/textures/items/iron_shovel.png b/android/assets/textures/items/iron_shovel.png
new file mode 100644 (file)
index 0000000..ed1d44b
Binary files /dev/null and b/android/assets/textures/items/iron_shovel.png differ
diff --git a/android/assets/textures/items/iron_sword.png b/android/assets/textures/items/iron_sword.png
new file mode 100644 (file)
index 0000000..6473327
Binary files /dev/null and b/android/assets/textures/items/iron_sword.png differ
diff --git a/android/assets/textures/items/stone_shovel.png b/android/assets/textures/items/stone_shovel.png
new file mode 100644 (file)
index 0000000..78cf790
Binary files /dev/null and b/android/assets/textures/items/stone_shovel.png differ
diff --git a/android/assets/textures/items/stone_sword.png b/android/assets/textures/items/stone_sword.png
new file mode 100644 (file)
index 0000000..c20ed6e
Binary files /dev/null and b/android/assets/textures/items/stone_sword.png differ
diff --git a/android/assets/textures/items/wood_shovel.png b/android/assets/textures/items/wood_shovel.png
new file mode 100644 (file)
index 0000000..32cb69a
Binary files /dev/null and b/android/assets/textures/items/wood_shovel.png differ
diff --git a/android/assets/textures/items/wood_sword.png b/android/assets/textures/items/wood_sword.png
new file mode 100644 (file)
index 0000000..8fcabc1
Binary files /dev/null and b/android/assets/textures/items/wood_sword.png differ
index 87bb3d66a0cd4c0ac3a1196dc115d8cdf4f88fa6..61b3af736653e9097b30df8f49ca1d6c0cfd280d 100644 (file)
@@ -113,11 +113,26 @@ public class GameItems {
             boolean fluid = (block.has("fluid") && block.getBoolean("fluid"));
             String meta = (block.has("meta") ? block.getString("meta") : "");
             String texture = (block.has("texture") ? block.getString("texture") : key);
+            Sprite sprite = key.equals("none") ? null :
+                    new Sprite(new Texture(Gdx.files.internal("textures/blocks/" + texture + ".png")));
+            Block newBlock = new Block(
+                    left,
+                    top,
+                    right,
+                    bottom,
+                    hp,
+                    drop,
+                    collision,
+                    background,
+                    transparent,
+                    blockRequired,
+                    fluid,
+                    meta,
+                    sprite
+            );
+
             blocksIds.put(key, blocks.size);
-            blocks.put(key, new Block(left, top, right, bottom, hp, drop, collision,
-                    background, transparent, blockRequired, fluid, meta,
-                    key.equals("none") ? null :
-                            new Sprite(new Texture(Gdx.files.internal("textures/" + texture + ".png")))));
+            blocks.put(key, newBlock);
             block = block.next();
         }
         while (item != null) {
@@ -125,9 +140,10 @@ public class GameItems {
             String name = (item.has("name") ? item.getString("name") : key);
             String type = (item.has("type") ? item.getString("type") : "item");
             String texture = (item.has("texture") ? item.getString("texture") : key);
+            Sprite sprite = type.equals("block") ? null :
+                    new Sprite(new Texture(Gdx.files.internal("textures/items/" + texture + ".png")));
             itemsIds.put(key, items.size);
-            items.put(key, new Item(name, type, type.equals("block") ? null :
-                    new Sprite(new Texture(Gdx.files.internal("textures/" + texture + ".png")))));
+            items.put(key, new Item(name, type, sprite));
             item = item.next();
         }
     }
index 9e54c9a5a74a54f4932f609124bc89088740acfe..252e77fe144ae79670dd014e9d1b217755692214 100644 (file)
@@ -241,7 +241,8 @@ public class GameRenderer extends Renderer {
             drawString("Mobs: " + GP.mobs.size(), 0, 50);
             drawString("Drops: " + GP.drops.size(), 0, 60);
             drawString("Block: " + GameItems.getBlockKey(GP.world.getForeMap(GP.curX, GP.curY)), 0, 70);
-            drawString("Game mode: " + GP.player.gameMode, 0, 80);
+            drawString("Hand: " + GameItems.getItemKey(GP.player.inv[GP.player.invSlot]), 0, 80);
+            drawString("Game mode: " + GP.player.gameMode, 0, 90);
         }
         spriter.end();