From 0f0a00cc4c8b1d80006682491179c41a285ef846 Mon Sep 17 00:00:00 2001 From: fred-boy Date: Tue, 19 Feb 2019 02:58:07 +0700 Subject: [PATCH] Add buckets --- android/assets/items.png | Bin 1704 -> 2359 bytes .../cavedroid/game/GameItems.java | 6 +++++ .../deadsoftware/cavedroid/game/GameProc.java | 22 +++++++++++++++--- .../cavedroid/game/GameRenderer.java | 3 +++ .../deadsoftware/cavedroid/misc/Assets.java | 2 +- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/android/assets/items.png b/android/assets/items.png index d4ca336da12bf638f97aee84ed09210ef7adac54..1da9653133e094f5ceb5385c224acc1b03b364e3 100644 GIT binary patch delta 2071 zcmX9;dr*=K7Ps22ch*X`$F;6w>|9?NT9&P(U0_|)hDG=EKl2gNO4!Zh9DE}LIQyF*{M?UnxzNY8tCE`Pmd+hL*i^<>PJ^g>^_&6Tq zz0RJ50PqE4rFvX zs*@cDCGJoqN!tQ*LgCeOza>10L7GU+;qdhpZ8KoDVvX3e)B)Sba6lf!9rRXJW59h_*9gi9qZ9 zHdBrZ3+Dj1Oc}w}4R=-wxeOw)M;owk*Uk=oXMFEg2cM)tn#;JRv9S>s_BQfG0d(yc zuQrWck7=TNrtvHDWn@(hy(cgoC;xzYRij`7CaG^Hm|$I`Auu(kdD)m03Fr4+0?#2Z z>XUCHn(Tv&ynnBkJ{6LbFFqR`ua% zv#+b{OSd@|NS33`$SM~cq-|u!U4e!!OtH-78)jj8pK5J!i=ojr*L4;re|Htg`YfqG zCm3?ZUC~5`{!IF*PXxHl_kLToU$i;{4aY(+%ZD7fkLm#R%u9MW$U6iDHk9fi zx5XYwgyt!;hF6tH(g>h}C&|HU+Sg&+l;n&0`)}I<%MYvHqO^v=78|YIa?hyC%k;+J zvNow|Y3aaIF1Nf*O5oKMlF9A4bp@#u0{Z}`2n|wTowcw&1MN5`+dcwdQr9wk@Yz_!W?B+wdfgnQ)w`y%| zZ4Uy$4?ftJH8!J~>T*M)(cbaxAc##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?{4x}*OXhkv?qVHT3u4| z_x1HHDS!D__x3C)`MbLxkahQw)2#ix4##wdw+YfifCh`H+^m56VcuMz>?09|8WQK z(1xy7A;@|82L=XOg&^nU-?eL3s}SV8{OfmqtW^kdUjDHsds~IzZYKZOa8H~(_f~fD zj}7<4^UwV#JNd_kd*YeTe=0lq$A){Nvj3~u$v-yS6Z^mLYsr7V+cvZ=eQwu>(zc;> z>3`XMkEX9b{YZLt-=nFxy}pxry`J{(-=FIBdYYV^OcN6mX>xKh6}Q)SQmfU{;lqbh ztyW7Zr8G4)l~PKnxV^rUuFXSf;0NDKU7Lr}j;m+WwwI2i9aqn$;`aKE-#@xF{rnfZ zQ+;%6nwj03&b|EUG&8$56}Q)AlYiowEq|#tu(nlHmlEIUIo>Y5({sFCe5dDlyZGF5 z^> z{mN`S_L225d+k=dIdfydVz85{|LW{OY~Q{;W@l$(dU|@nVz86=7yn$10|ySo`Sa)F z^Uvr*l}T@%(?SZeP|ETDH_&41Y#MTC4~xjGu1BHy4A86@m8ng9i_$=3+1+(qcuR z7=L5>dS&Kk&!^^MFe1`oMc{VdKlWsAL_}Jw2-F7FrbjkbqwNek?|fExJol&oG~4|4 zd99G}X|a|+B4V&-dO>_M;TIbNnr;5z#`y*Dg@jLwwfyhKzq25|knm}-mRmm}VzB%A z!teiY!gtihF7@)S^my)rnLj7KIP>Sk7ia#Q_~Oi;_5FpJf2n8L80lTo+`H1_xd%Id zV&Zo?>%UhAP<-{v7J%mOPG|l1>Hyka{Za*>_5CGgeUmW=?HK@orTPyYCX$b}<5BPc O0000 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 762492f..1229fcb 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java @@ -135,6 +135,7 @@ public class GameRenderer extends Renderer { 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); @@ -149,6 +150,7 @@ public class GameRenderer extends Renderer { 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; @@ -174,6 +176,7 @@ public class GameRenderer extends Renderer { 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 9066d4b..6eb0e60 100644 --- a/core/src/ru/deadsoftware/cavedroid/misc/Assets.java +++ b/core/src/ru/deadsoftware/cavedroid/misc/Assets.java @@ -11,7 +11,7 @@ import ru.deadsoftware.cavedroid.CaveGame; 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; -- 2.29.2