diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-10 02:07:12 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-10 02:07:12 +0500 |
| commit | b7736a15442cee4c56ee8d0badeaf4201ed69a6d (patch) | |
| tree | ea73f47b4af50fc3cd509e7053efafd037e6787b | |
| parent | 1b99e89ecc92f3bf53cf483d38ad8d0156c5db5e (diff) | |
feat: sounds for shop ui
| -rw-r--r-- | assets/sfx/shop/not_enough_money.ogg | bin | 0 -> 6823 bytes | |||
| -rw-r--r-- | assets/sfx/shop/purchase.ogg | bin | 0 -> 13749 bytes | |||
| -rw-r--r-- | assets/sfx/shop/sell.ogg | bin | 0 -> 7599 bytes | |||
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/screens/game/shop/ShopUI.java | 8 |
4 files changed, 7 insertions, 1 deletions
diff --git a/assets/sfx/shop/not_enough_money.ogg b/assets/sfx/shop/not_enough_money.ogg Binary files differnew file mode 100644 index 0000000..015062d --- /dev/null +++ b/assets/sfx/shop/not_enough_money.ogg diff --git a/assets/sfx/shop/purchase.ogg b/assets/sfx/shop/purchase.ogg Binary files differnew file mode 100644 index 0000000..e28a4cc --- /dev/null +++ b/assets/sfx/shop/purchase.ogg diff --git a/assets/sfx/shop/sell.ogg b/assets/sfx/shop/sell.ogg Binary files differnew file mode 100644 index 0000000..fdae919 --- /dev/null +++ b/assets/sfx/shop/sell.ogg diff --git a/core/src/kz/ilotterytea/maxon/screens/game/shop/ShopUI.java b/core/src/kz/ilotterytea/maxon/screens/game/shop/ShopUI.java index ed29326..71af190 100644 --- a/core/src/kz/ilotterytea/maxon/screens/game/shop/ShopUI.java +++ b/core/src/kz/ilotterytea/maxon/screens/game/shop/ShopUI.java @@ -35,12 +35,15 @@ public class ShopUI { private final ArrayList<PetWidget> petWidgets = new ArrayList<>(); - private final Sound clickSound; + private final Sound clickSound, notEnoughMoneySound, purchaseSound, sellSound; public ShopUI(final Savegame savegame, Stage stage, Skin skin, TextureAtlas atlas) { this.savegame = savegame; MaxonGame game = MaxonGame.getInstance(); this.clickSound = game.assetManager.get("sfx/ui/click.ogg", Sound.class); + this.notEnoughMoneySound = game.assetManager.get("sfx/shop/not_enough_money.ogg", Sound.class); + this.purchaseSound = game.assetManager.get("sfx/shop/purchase.ogg", Sound.class); + this.sellSound = game.assetManager.get("sfx/shop/sell.ogg", Sound.class); this.skin = skin; this.atlas = atlas; @@ -244,6 +247,7 @@ public class ShopUI { super.clicked(event, x, y); if (widget.isDisabled()) { + notEnoughMoneySound.play(); return; } @@ -255,6 +259,7 @@ public class ShopUI { savegame.getPurchasedPets().getOrDefault(pet.getId(), 0) + multiplier.getMultiplier() ); + purchaseSound.play(); } else { savegame.increaseMoney(widget.getPrice()); savegame.decreaseMultiplier(pet.getMultiplier() * multiplier.getMultiplier()); @@ -263,6 +268,7 @@ public class ShopUI { savegame.getPurchasedPets().get(pet.getId()) - multiplier.getMultiplier() ); + sellSound.play(); } } }); |
