From a76f96e6d6e5ffdfa610328cb30714caf9a453d1 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 10 Jun 2024 01:35:53 +0500 Subject: feat: purr on player click --- assets/sfx/player/purr.ogg | Bin 0 -> 5824 bytes core/src/kz/ilotterytea/maxon/player/DecalPlayer.java | 5 +++++ 2 files changed, 5 insertions(+) create mode 100755 assets/sfx/player/purr.ogg diff --git a/assets/sfx/player/purr.ogg b/assets/sfx/player/purr.ogg new file mode 100755 index 0000000..e4db8f1 Binary files /dev/null and b/assets/sfx/player/purr.ogg differ diff --git a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java index 60faf9b..5ce2abe 100644 --- a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java +++ b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java @@ -1,6 +1,7 @@ package kz.ilotterytea.maxon.player; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g3d.decals.Decal; @@ -8,6 +9,7 @@ import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.math.collision.Ray; +import kz.ilotterytea.maxon.MaxonGame; public class DecalPlayer { private final TextureRegion[] regions; @@ -56,6 +58,9 @@ public class DecalPlayer { if (Intersector.intersectRayBounds(ray, box, intersection)) { updateTextureRegion(); savegame.increaseMoney(1); + + Sound sound = MaxonGame.getInstance().assetManager.get("sfx/player/purr.ogg", Sound.class); + sound.play(); } } -- cgit v1.2.3