summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a855ca)
raw | patch | inline | side by side (parent: 0a855ca)
author | fred-boy <fred-boy@protonmail.com> | |
Mon, 18 Feb 2019 19:58:07 +0000 (02:58 +0700) | ||
committer | fred-boy <fredboy@protonmail.com> | |
Sun, 29 Sep 2019 04:38:50 +0000 (11:38 +0700) |
index d4ca336da12bf638f97aee84ed09210ef7adac54..1da9653133e094f5ceb5385c224acc1b03b364e3 100644 (file)
Binary files a/android/assets/items.png and b/android/assets/items.png differ
Binary files a/android/assets/items.png and b/android/assets/items.png differ
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java
index 39b9dfacff283c046f2ac41cb4637f2641c8370c..6c511a4fb260de21abe7dd196226005b1f14ea3f 100644 (file)
items.add(new Item("Diamond Shovel", 8, 1));
//63
items.add(new Item("Golden Shovel", 9, 1));
+ //64
+ items.add(new Item("Empty Bucket", 10, 2));
+ //65
+ items.add(new Item("Water Bucket", 11, 2));
+ //66
+ items.add(new Item("Lava Bucket", 12, 2));
}
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameProc.java b/core/src/ru/deadsoftware/cavedroid/game/GameProc.java
index 7364e5967c767fcb3cc9be56d27400080c95a7a5..aa11931410fd72428ff93927d73f2b834e1b24b6 100644 (file)
}
void useItem(int x, int y, int id, boolean bg) {
- if (id > 0 && GameItems.getItem(id).getType() == 0) {
- if (!bg) world.placeToForeground(x, y, GameItems.getItem(id).getBlock());
- else world.placeToBackground(x, y, GameItems.getItem(id).getBlock());
+ if (id > 0) {
+ switch (GameItems.getItem(id).getType()) {
+ case 0:
+ if (!bg) world.placeToForeground(x, y, GameItems.getItem(id).getBlock());
+ else world.placeToBackground(x, y, GameItems.getItem(id).getBlock());
+ break;
+ case 2:
+ switch (id) {
+ case 65:
+ world.placeToForeground(x, y, 8);
+ player.inv[player.invSlot] = 64;
+ break;
+ case 66:
+ world.placeToForeground(x, y, 9);
+ player.inv[player.invSlot] = 64;
+ break;
+ }
+ break;
+ }
}
}
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java
index 762492f4282d1bad8158f8fa1bb2395bec196ca8..1229fcb1e04ad68973c76726774598fc553e1313 100644 (file)
y + 18 + ((i - GP.creativeScroll * 8) / 8) * 18);
break;
case 1:
+ case 2:
spriter.draw(Assets.itemTex[GameItems.getItem(i).getTex()],
x + 8 + ((i - GP.creativeScroll * 8) % 8) * 18,
y + 18 + ((i - GP.creativeScroll * 8) / 8) * 18);
x + 8 + i * 18, y + Assets.creativeInv.getRegionHeight() - 24);
break;
case 1:
+ case 2:
spriter.draw(Assets.itemTex[GameItems.getItem(GP.player.inv[i]).getTex()],
x + 8 + i * 18, y + Assets.creativeInv.getRegionHeight() - 24);
break;
3);
break;
case 1:
+ case 2:
spriter.draw(Assets.itemTex[GameItems.getItem(GP.player.inv[i]).getTex()],
getWidth() / 2 - (float) Assets.invBar.getRegionWidth() / 2 + 3 + i * 20,
3);
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/Assets.java b/core/src/ru/deadsoftware/cavedroid/misc/Assets.java
index 9066d4bfeede1ce9991eaf35791b2812a9e98bb9..6eb0e60dc03b64f55c91eb00cf1921506283f1ec 100644 (file)
public class Assets {
public static final int BLOCK_TEXTURES = 66;
- public static final int ITEM_TEXTURES = 10;
+ public static final int ITEM_TEXTURES = 13;
private static GlyphLayout layout;